Select
Lets the user pick one option from a list.
Use it for: A fixed set of choices for a text field, inside a Form.
- CategoryInput
- ChildrenNone
- DataOne field (bindings.value)
- ActionNone
| Prop | Required | Accepts | What it does |
|---|---|---|---|
label |
Yes | text, up to 200 characters | The visible label, also read by VoiceOver. |
required |
No | true or false |
The form cannot be saved while this is empty. |
disabled |
No | true or false |
Show it greyed out and ignore taps. |
options |
Yes | list of 1 to 50 items | The choices, each with a label to show and a value to store. |
Every component also accepts id (required, unique on its screen), and the optional preset and style described in Style options.
Example
Section titled “Example”From the fitness example project:
{ "id": "category", "type": "Select", "props": { "label": "Category", "required": true, "options": [ { "label": "Strength", "value": "strength" }, { "label": "Cardio", "value": "cardio" }, { "label": "Mobility", "value": "mobility" } ] }, "bindings": { "value": { "model": "workout", "field": "category" } }}