Forms
Select
Chooses a value from a compact anchored list.
Usage
Anatomy
The parts and how they nest, taken from the preview above.
Examples
Single selection
Supply items so the trigger can resolve the selected label before the popup opens.
Controlled multiple selection
Use an array value with multiple. Selecting an option toggles its membership.
Small select
Use this size to match the density of the surrounding interface.
Large select
Use this size to match the density of the surrounding interface.
Managed select
Disabled controls cannot be edited or focused.
Read-only select
Read-only controls allow selection and copying without edits.
Required workspace
Use an invalid state with a nearby explanation of the error.
Recommendations
| Guidance | Practice |
|---|---|
| Do | Label the field and use readable option names. Provide explicit labels when values are objects. |
| Do | SelectLabel names the trigger. Enter or Space opens the popup; arrow keys move through options and typing finds matching labels. Escape dismisses it. |
| Do | Uncontrolled composition with serializable items can live in a Server Component. Controlled values, callbacks, and object formatting functions belong in a Client Component. |
Usage boundaries
| Guidance | Boundary |
|---|---|
| Scope | Use Combobox for text filtering. Multiple selection needs visible selected values and a clear way to change them. |
API reference
Public props from @mizen-labs/ui. Use exported prop types for the complete TypeScript contract.
| Prop | Type | Default | Description |
|---|---|---|---|
| | — | Controls the selected value or values. |
| | — | Sets initial selection. |
| | — | Receives selection changes. |
| | false | Enables selecting more than one item. |
| | — | Associates the hidden input with a form by id, including when the Select is portaled. |
| | — | Names and opens the select; supports size and invalid state. |
| | — | Displays the selected item or a placeholder. |
| | — | Positions the list and can set its portal container. |
| | — | Declares a selectable value. |
| | — | Groups related items. |