Components · Inputs
Select
A dropdown of text options. Bind value with { "$bindState": "/path" }. Takes description, error, hideLabel, disabled, and fullWidth like Input.
ExamplesLink to this section
Environment
Deploying to Preview.
Show JSONHide JSON
{
"version": 1,
"root": "page",
"elements": {
"page": {
"type": "Stack",
"props": { "gap": "sm" },
"children": ["env", "chosen"]
},
"env": {
"type": "Select",
"props": {
"label": "Environment",
"options": ["Production", "Preview", "Development"],
"value": { "$bindState": "/env" }
}
},
"chosen": {
"type": "Text",
"props": {
"size": "sm",
"tone": "muted",
"text": { "$template": "Deploying to ${/env}." }
}
}
},
"state": { "env": "Preview" }
}PropsLink to this section
Generated from the zod schema the server validates with. Unknown props are ignored with a warning. Any prop can also be a dynamic value such as { "$state": "/path" }; it is checked again once it resolves.
| Prop | Type | Limits and defaults |
|---|---|---|
| labelrequired | string | max 120 chars |
| optionsrequired | string[] | 1–100 items |
| value | string | max 120 chars |
| placeholder | string | max 80 chars |
| fullWidth | boolean | — |
| description | string | max 400 chars |
| error | string | max 300 chars |
| hideLabel | boolean | — |
| disabled | boolean | — |
RulesLink to this section
- Inputs change only the spec's own state, on the reader's page. Nothing is saved or sent.
descriptionsits under the label.errormarks the field invalid and shows the message.hideLabelkeeps the label for screen readers only.- A Select is at most 384 pixels wide;
fullWidthlets it fill its container, like Input and Textarea.
Children and eventsLink to this section
Select is a leaf: it does not show children. Validation warns when a leaf has some; wrap them in a Stack or Card instead.
Events: change. Bind one with on to run a state action; see Actions.