Select
Let people choose one option from a menu with a select control. See default and disabled examples.
Examples
Default
Breakpoints
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxselect-demo.tsx
Disabled
Breakpoints
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxselect-disabled-demo.tsx
Component API
Put Field and optional Icon inside Root. Field is the native select control.
Root<div>
Owns value and validation state.
| Prop | Type | Description |
|---|---|---|
defaultValue | string | Initial uncontrolled selection. |
value | string | Controlled selection. |
onValueChange | (value: string) => void | Receives selection changes. |
name | string | Form field name. |
required | boolean | Requires a selection. |
disabled | boolean | Disables the select. |
invalid | boolean | Marks the selection invalid. |
readOnly | boolean | Passes readOnly to the select. Native select elements do not enforce read-only behavior; use disabled to prevent interaction. |
| Attribute | Value | Purpose |
|---|---|---|
data-disabled | Present when disabled | Style the disabled state. |
data-invalid | Present when invalid | Style the error state. |
Field<select>
Native select control containing option elements.
| Attribute | Value | Purpose |
|---|---|---|
data-disabled | Present when disabled | Style the disabled state. |
data-invalid | Present when invalid | Style the error state. |
Icon<div>
Displays the dropdown indicator.
| Attribute | Value | Purpose |
|---|---|---|
data-disabled | Present when disabled | Style the disabled state. |
data-invalid | Present when invalid | Style the error state. |