Select for a form value chosen from a list. Use Menu for commands and actions.
Single selection
items on Root so Value renders the selected item’s label; without it, the trigger shows the raw value. defaultValue initializes uncontrolled state; use value and onValueChange for controlled state. The selected value can be null when nothing is selected.
Multiple selection
multiple, the value is an array. The generic root types represent the option value and whether multiple selection is enabled.
Parts and placement
Popup defaults to side="bottom", align="start", and sideOffset={8}. Set alignItemWithTrigger to align the selected option over the trigger. It uses the theme’s portal container unless you provide container.
Keyboard users can open the list from the trigger, navigate options with arrow keys, and type to find an option. Escape dismisses the popup. Label the trigger or integrate the select with Field; a placeholder alone does not name the control.
Props
The reference is generated from the public component types. Native attributes, including accessible names and event handlers, are also accepted on parts that render elements.Select.Root
RefObject<SelectRootActions | null>
A ref to imperative actions.
unmount: Manually unmounts the select. Call this after any externally controlled closing animation finishes.
string
Provides a hint to the browser for autofill.
boolean
default:"false"
Whether the select popup is initially open.To render a controlled select popup, use the
open prop instead.SelectValueType<Value, Multiple> | null
The uncontrolled value of the select when it’s initially rendered.To render a controlled select, use the
value prop instead.boolean
default:"false"
Whether the component should ignore user interaction.
string
Identifies the form that owns the hidden input.
Useful when the select is rendered outside the form.
boolean
default:"true"
Whether moving the pointer over items should highlight them.
Disabling this prop allows CSS
:hover to be differentiated from the :focus (data-highlighted) state.string
The id of the Select.
Ref<HTMLInputElement>
A ref to access the hidden input element.
((itemValue: Value, value: Value) => boolean)
Custom comparison logic used to determine if a select item value matches the current selected value. Useful when item values are objects without matching referentially.
Defaults to
Object.is comparison.Record<string, ReactNode> | readonly { label: ReactNode; value: any; }[] | readonly Group<any>[]
Data structure of the items rendered in the select popup.
When specified,
<Select.Value> renders the label of the selected item instead of the raw value.((itemValue: Value) => string)
When the item values are objects (
<Select.Item value={object}>), this function converts the object value to a string representation for display in the trigger.
If the shape of the object is { value, label }, the label will be used automatically without needing to specify this prop.((itemValue: Value) => string)
When the item values are objects (
<Select.Item value={object}>), this function converts the object value to a string representation for form submission.
If the shape of the object is { value, label }, the value will be used automatically without needing to specify this prop.boolean
default:"true"
Determines if the select enters a modal state when open.
true: user interaction is limited to the select: document page scroll is locked and pointer interactions on outside elements are disabled.false: user interaction with the rest of the document is allowed.
true modal blocks outside taps but leaves the page scrollable unless the popup spans nearly the full viewport width, matching native iOS behavior.boolean
default:"false"
Whether multiple items can be selected.
string
Identifies the field when a form is submitted.
((open: boolean, eventDetails: SelectRootChangeEventDetails) => void)
Event handler called when the select popup is opened or closed.
((open: boolean) => void)
Event handler called after any animations complete when the select popup is opened or closed.
((value: SelectValueType<Value, Multiple> | (Multiple extends true ? never : null), eventDetails: SelectRootChangeEventDetails) => void)
Event handler called when the value of the select changes.
boolean
Whether the select popup is currently open.
boolean
default:"false"
Whether the user should be unable to choose a different option from the select popup.
boolean
default:"false"
Whether the user must choose a value before submitting a form.
SelectValueType<Value, Multiple> | null
The value of the select. Use when controlled.
Select.Trigger
string | ((state: SelectTriggerState) => string | undefined)
CSS class applied to the element, or a function that
returns a class based on the component’s state.
boolean
Whether the component should ignore user interaction.
boolean
default:"true"
Whether the component renders a native
<button> element when replacing it
via the render prop.
Set to false if the rendered element is not a button (for example, <div>).ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectTriggerState>
Allows you to replace the component’s HTML element
with a different tag, or compose it with another component.Accepts a
ReactElement or a function that returns the element to render."sm" | "md"
default:"md"
Visual size of the trigger.
CSSProperties | ((state: SelectTriggerState) => CSSProperties | undefined)
Style applied to the element, or a function that
returns a style object based on the component’s state.
Select.Value
ReactNode | ((value: any) => ReactNode)
Accepts a function that returns a
ReactNode to format the selected value.
Treat the value as read-only: in multiple mode it may be a shared frozen array
when nothing is selected.string | ((state: SelectValueState) => string | undefined)
CSS class applied to the element, or a function that
returns a class based on the component’s state.
ReactNode
The placeholder value to display when no value is selected.
This is overridden by
children if specified, or by a null item’s label in items.ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectValueState>
Allows you to replace the component’s HTML element
with a different tag, or compose it with another component.Accepts a
ReactElement or a function that returns the element to render.CSSProperties | ((state: SelectValueState) => CSSProperties | undefined)
Style applied to the element, or a function that
returns a style object based on the component’s state.
Select.Popup
"center" | "start" | "end"
default:"start"
How to align the popup relative to the specified side.
boolean
default:"false"
Whether the positioner overlaps the trigger so the selected item’s text is aligned with the trigger’s value text. This only applies to mouse input and is automatically disabled if there is not enough space.
number | OffsetFunction
default:"0"
Additional offset along the alignment axis in pixels.
Also accepts a function that returns the offset to read the dimensions of the anchor
and positioner elements, along with its side and alignment.The function takes a
data object parameter with the following properties:data.anchor: the dimensions of the anchor element with propertieswidthandheight.data.positioner: the dimensions of the positioner element with propertieswidthandheight.data.side: which side of the anchor element the positioner is aligned against.data.align: how the positioner is aligned relative to the specified side.
Element | VirtualElement | RefObject<Element | null> | (() => Element | VirtualElement | null) | null
An element to position the popup against.
By default, the popup will be positioned against the trigger.
string | ((state: SelectPopupState) => string | undefined)
CSS class applied to the element, or a function that
returns a class based on the component’s state.
HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null
Element the popup is portaled into. Defaults to the theme’s portal
container.
boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | void | HTMLElement | null)
Determines the element to focus when the select popup is closed.
false: Do not move focus.true: Move focus based on the default behavior (trigger or previously focused element).RefObject: Move focus to the ref element.function: Called with the interaction type (mouse,touch,pen, orkeyboard). Return an element to focus,trueto use the default behavior, orfalse/undefinedto do nothing.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPopupState>
Allows you to replace the component’s HTML element
with a different tag, or compose it with another component.Accepts a
ReactElement or a function that returns the element to render."top" | "bottom" | "left" | "right" | "inline-end" | "inline-start"
default:"bottom"
Which side of the anchor element to align the popup against.
May automatically change to avoid collisions.
number | OffsetFunction
default:"8"
Distance between the anchor and the popup in pixels.
Also accepts a function that returns the distance to read the dimensions of the anchor
and positioner elements, along with its side and alignment.The function takes a
data object parameter with the following properties:data.anchor: the dimensions of the anchor element with propertieswidthandheight.data.positioner: the dimensions of the positioner element with propertieswidthandheight.data.side: which side of the anchor element the positioner is aligned against.data.align: how the positioner is aligned relative to the specified side.
CSSProperties | ((state: SelectPopupState) => CSSProperties | undefined)
Style applied to the element, or a function that
returns a style object based on the component’s state.
Select.Item
string | ((state: SelectItemState) => string | undefined)
CSS class applied to the element, or a function that
returns a class based on the component’s state.
ReactNode
Supporting text, placed according to
descriptionPlacement."inline" | "end"
default:"inline"
Where the description renders: inline after the content or at the end of
the row.
boolean
default:"false"
Whether the component should ignore user interaction.
ReactNode
Icon rendered after the content.
string
Specifies the text label to use when the item is matched during keyboard text navigation.Defaults to the item text content if not provided.
boolean
default:"false"
Whether the component renders a native
<button> element when replacing it
via the render prop.
Set to true if the rendered element is a native button.ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectItemState>
Allows you to replace the component’s HTML element
with a different tag, or compose it with another component.Accepts a
ReactElement or a function that returns the element to render.ReactNode
Icon rendered before the content.
CSSProperties | ((state: SelectItemState) => CSSProperties | undefined)
Style applied to the element, or a function that
returns a style object based on the component’s state.
any
default:"null"
A unique value that identifies this select item.
Select.Group
string | ((state: SelectGroupState) => string | undefined)
CSS class applied to the element, or a function that
returns a class based on the component’s state.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectGroupState>
Allows you to replace the component’s HTML element
with a different tag, or compose it with another component.Accepts a
ReactElement or a function that returns the element to render.CSSProperties | ((state: SelectGroupState) => CSSProperties | undefined)
Style applied to the element, or a function that
returns a style object based on the component’s state.
Select.GroupLabel
string | ((state: SelectGroupLabelState) => string | undefined)
CSS class applied to the element, or a function that
returns a class based on the component’s state.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectGroupLabelState>
Allows you to replace the component’s HTML element
with a different tag, or compose it with another component.Accepts a
ReactElement or a function that returns the element to render.CSSProperties | ((state: SelectGroupLabelState) => CSSProperties | undefined)
Style applied to the element, or a function that
returns a style object based on the component’s state.
Select.Separator
string | ((state: SelectSeparatorState) => string | undefined)
CSS class applied to the element, or a function that
returns a class based on the component’s state.
"horizontal" | "vertical"
default:"horizontal"
The orientation of the separator.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectSeparatorState>
Allows you to replace the component’s HTML element
with a different tag, or compose it with another component.Accepts a
ReactElement or a function that returns the element to render.CSSProperties | ((state: SelectSeparatorState) => CSSProperties | undefined)
Style applied to the element, or a function that
returns a style object based on the component’s state.