Skip to content

Component

Edmund edited this page Sep 14, 2018 · 16 revisions

A component (in the Synergy context, not to be confused with React components) forms up with other components (typically) to form a Module.

Props

Prop Type Description
name String The name of the component
[tag='div'] String HTML tag to use when rendering the module
[modifiers] Array Modifiers to add to the rendered module
[className] String CSS classes to add to the rendered module
[on{event}] Function Any valid GlobalEventHandler (you must use camelCase to be compatible with React)
[{HTML Attribute}] String Any valid HTML attribute
Example
<Module name='accordion'>
    <Component name="panel">
        <Component name="title">foo</Component>
        <Component name="content">bar</Component>
    </Component>
    <Component name="panel">
        <Component name="title">fizz</Component>
        <Component name="content">buzz</Component>
    </Component>
</Module>
Output
<div class="accordion">
    <div class="accordion_panel">
        <div class="accordion_title">foo</div>
        <div class="accordion_content">bar</div>
    </div>
    <div class="accordion_panel">
        <div class="accordion_title">fizz</div>
        <div class="accordion_content">buzz</div>
    </div>
</div>
Clone this wiki locally