boundless-segmented-control
v1.1.0
Published
A control containing multiple buttons, only one of which can be active at a time.
Downloads
7
Maintainers
Readme
THIS IS AN AUTOGENERATED FILE. EDIT INDEX.JS INSTEAD.
SegmentedControl
A control containing multiple buttons, only one of which can be active at a time.
SegmentedControl is implemented as a "controlled component", meaning it is a direct representation of the model data passed inside. User interaction will bubble changes in the form of onOptionSelected
that a controller view must intercept and apply against the data provider.
Props
Note: only top-level props are in the README, for the full list check out the website.
Required Props
There are no required props.
Optional Props
<tr>
<td>onOptionSelected</td>
<td><pre><code>function</code></pre></td>
<td><pre><code class="language-js">noop</code></pre></td>
<td>called when a child element becomes selected; backing data must be updated to persist the state change</td>
</tr>
<tr>
<td>options</td>
<td><pre><code>custom</code></pre></td>
<td><pre><code class="language-js">[]</code></pre></td>
<td>the backing data for the segments of the rendered control
Validation Criteria:
- There must be at least two
options
(a segmented control with one button is not allowed)- There must only be one
option
whoseselected
attribute istrue
(multiple selections are not allowed)- Each
value
attribute must be unique across the set ofoptions
- options[].selected
Boolean
- options[].value
String
- options[].content
*
the content to go inside the button