Import
Basic Usage
Sub-components
Select.Root
Groups all parts of the select. Doesn’t render its own HTML element. Key Props:value: Controlled selected value (or array formultiple={true})defaultValue: Uncontrolled default valueonValueChange: Called when selection changesmultiple: Whether multiple items can be selected (default:false)open: Controlled popup open statedefaultOpen: Uncontrolled default open state (default:false)onOpenChange: Called when popup opens/closesonOpenChangeComplete: Called after animation completesdisabled: Whether component is disabled (default:false)readOnly: Whether user can change selection (default:false)required: Whether field is required (default:false)name: Form field nameautoComplete: Browser autocomplete hintmodal: Whether popup is modal (default:true)items: Data structure of items (for rendering labels in Value)itemToStringLabel: Convert object items to string for displayitemToStringValue: Convert object items to string for form submissionisItemEqualToValue: Custom equality function for object itemshighlightItemOnHover: Whether hovering highlights items (default:true)actionsRef: Ref to imperative actionsinputRef: Ref to the hidden input element
Select.Trigger
The button that opens/closes the select popup. Renders a<button> element.
State attributes:
data-open: Present when popup is opendata-disabled: Present when disabled
Select.Value
Displays the selected value or placeholder text. Props:placeholder: Text shown when no value is selected
Select.Icon
Icon indicating the select can be opened (typically a chevron).Select.Portal
Portals the popup to a different part of the DOM (default:document.body).
Props:
container: The container to portal intokeepMounted: Keep popup mounted when closed (default:false)
Select.Positioner
Positions the popup relative to the trigger using floating-ui. Props:side: Preferred side -'top'|'right'|'bottom'|'left'(default:'bottom')align: Alignment -'start'|'center'|'end'(default:'center')sideOffset: Distance from trigger in pixels (default:0)alignOffset: Offset along alignment axis (default:0)collisionBoundary: Boundary for collision detectioncollisionPadding: Padding from boundary edges (default:10)sticky: Whether to stick to boundary edges (default:false)
Select.Popup
The container for the list of items. State attributes:data-open: Present when openingdata-closed: Present when closingdata-starting-style: Present during initial animationdata-ending-style: Present during exit animation
Select.List
Scrollable list container for items.Select.Item
An individual selectable item. Renders a<div> by default.
Props:
value: The value this item represents (required)disabled: Whether this item is disabled (default:false)
data-highlighted: Present when highlighted via keyboard/hoverdata-selected: Present when selecteddata-disabled: Present when disabled
Select.ItemText
The text content of an item. Required for proper accessibility.Select.ItemIndicator
Only visible when the item is selected (for checkmark icons).Select.Group
Groups related items together.Select.GroupLabel
Label for a group of items. Renders a<div> by default.
Select.Separator
Visual separator between items or groups.Select.Arrow
Arrow pointing to the trigger.Select.ScrollUpArrow
Shown when list can scroll up.Select.ScrollDownArrow
Shown when list can scroll down.Select.Backdrop
Backdrop element shown behind popup whenmodal={true}.