Select API

API documentation for Select component

SelectRoot#

Props#

Defines valid properties in Select component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectRootInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectRootInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectRootPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectRootInstance) => ReactNode)
null
The children to render.
multipleboolean
null
When enabled, allows multiple items to be selected.
checkmarkboolean
null
When enabled, displays a checkmark icon next to the selected option.
invalidboolean
null
When present, it specifies that the component should have invalid state style.
variant"outlined" | "filled"
null
Specifies the input variant of the component.
fluidboolean
null
Spans 100% width of the container when enabled.
disabledboolean
false
When present, it specifies that the element should be disabled.
size"small" | "large"
null
Defines the size of the component.
onValueChange(event: SelectValueChangeEvent) => void
null
Callback fired when the select's value is changed.
onFilterValueChange(event: SelectFilterValueChangeEvent) => void
null
Callback fired when the select's filter value is changed.
valueunknown
null
The current selected value of the select.
defaultValueunknown
null
The default selected value when used in uncontrolled mode.
filterValuestring
null
The current filter text value (controlled).
defaultFilterValuestring
null
The default filter text value when used in uncontrolled mode.
openboolean
null
Controlled open state of the select overlay.
defaultOpenboolean
null
Default open state for uncontrolled mode.
optionsunknown[]
null
An array of options to display.
optionKeystring
null
Unique key for each option.
optionLabelstring
null
Label field for each option.
optionValuestring
null
Value field for each option.
optionDisabledstring
null
Field to check if an option is disabled.
optionGroupLabelstring
null
Label field for option groups.
optionGroupChildrenstring
null
Field that contains the children options in a group.
localestring
null
The locale to use for localization.
autoOptionFocusboolean
null
When enabled, the focused option is automatically highlighted.
selectOnFocusboolean
null
When enabled, the focused option is automatically selected.
focusOnHoverboolean
null
When enabled, the focused option changes on hover.
filterboolean
null
When enabled, displays a filter input in the dropdown.
filterMatchMode"endsWith" | "startsWith" | "contains" | "equals"
null
Defines how the filter should match options.
appendToHTMLElement | "body" | "self"
null
A valid query selector or an HTMLElement to specify where the overlay gets attached.
ariaLabelstring
null
Used to define a string that labels the input element.
ariaLabelledBystring
null
Identifier of the underlying input element.
onOpenChange(event: useSelectOpenChangeEvent) => void
null
Callback to invoke when the open state changes.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Defines valid state in Select component.

nametypedefaultdescription
valueunknown
null
The current selected value.
filterValuestring
null
The current filter text value.
openedboolean
null
Whether the overlay is open.
focusedboolean
null
Whether the trigger is focused.
focusedOptionIndexnumber
null
The index of the currently focused option. -1 if no option is focused.
anchorElHTMLElement
null
The anchor (trigger) element.
positionerElHTMLDivElement
null
The positioner element.

Exposes#

Defines the methods and properties exposed by Select component.

nametypedefaultdescription
stateuseSelectState
null
The state of the useSelect.
listboxuseListboxInstance
null
The listbox instance used internally for option management.
presence{ present: boolean; exiting: boolean; mounted: boolean; ref: RefObject<HTMLElement> }
null
The presence state for managing mount/unmount transitions.
triggerRefRefObject<HTMLElement>
null
Reference to the trigger element.
setAnchorRef(node: HTMLElement) => void
null
Sets the anchor (trigger) element reference.
setPositionerRef(node: HTMLDivElement) => void
null
Sets the positioner element reference.
onContainerClick(event: MouseEvent<HTMLDivElement>) => void
null
Callback when the container is clicked.
onKeyDown(event: KeyboardEvent<HTMLElement>) => void
null
Callback when a key is pressed on the trigger.
onFilterKeyDown(event: KeyboardEvent<HTMLInputElement>) => void
null
Callback when a key is pressed in the filter input.
onClearClick(event: MouseEvent<HTMLButtonElement>) => void
null
Callback when the clear button is clicked.
onOptionSelect(event: { originalEvent: SyntheticEvent; value: unknown }) => void
null
Callback when an option is selected.
getFocusedOptionId() => string
null
Gets the ID of the currently focused option for aria-activedescendant.
getSelectedOptionLabel() => unknown
null
Gets the label of the currently selected option.
hasValue() => boolean
null
Checks if there is a selected value.
show() => void
null
Shows the overlay.
hide() => void
null
Hides the overlay.
toggle(event: SyntheticEvent) => void
null
Toggles the overlay visibility.

Events#

Event fired when the select's value changes.

nametypedescription
valueunknownThe new value of the select.
optionunknownThe selected option.
originalEventSyntheticEventThe original event that triggered the change.

Event fired when the select's filter value changes.

nametypedescription
querystringThe current filter query.
originalEventSyntheticEventThe original event that triggered the change.

Event object for the onOpenChange callback.

nametypedescription
valuebooleanThe new value of the select's open state.

Interfaces#

Defines passthrough(pt) options of Select component.

nametypedefaultdescription
rootSelectRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.
triggerSelectRootPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the trigger's DOM element.
valueSelectRootPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the value's DOM element.
clearIconSelectRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the clear icon's DOM element.
iconSelectRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the icon's DOM element.
portalSelectRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the portal's DOM element.
positionerSelectRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the positioner's DOM element.
panelSelectRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the panel's DOM element.
filterSelectRootPassThroughType<HTMLAttributes<HTMLInputElement>>
null
Used to pass attributes to the filter's DOM element.
pcListboxSelectRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the listbox's DOM element.
optionsSelectRootPassThroughType<HTMLAttributes<HTMLUListElement>>
null
Used to pass attributes to the options' DOM element.
optionSelectRootPassThroughType<HTMLAttributes<HTMLLIElement>>
null
Used to pass attributes to the option's DOM element.
selectionSelectRootPassThroughType<HTMLAttributes<HTMLElement>>
null
Used to pass attributes to the selection's DOM element.
headerSelectRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the header's DOM element.
footerSelectRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the footer's DOM element.
emptySelectRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the empty's DOM element.

Types#

Instance of SelectRoot component.

values
ComponentInstance<SelectRootProps, SelectRootState, SelectRootExposes>

SelectTrigger#

Props#

Defines valid properties in SelectTrigger component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectTriggerInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectTriggerInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectTriggerPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectTriggerInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectTrigger component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.

Interfaces#

Defines passthrough(pt) options of SelectTrigger component.

nametypedefaultdescription
rootSelectTriggerPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SelectTrigger component.

values
ComponentInstance<SelectTriggerProps, SelectTriggerState, SelectTriggerExposes>

SelectIcon#

Props#

Defines valid properties in SelectIcon component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectIconInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectIconInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectIconPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectIconInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectIcon component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.

Interfaces#

Defines passthrough(pt) options of SelectIcon component.

nametypedefaultdescription
rootSelectIconPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SelectIcon component.

values
ComponentInstance<SelectIconProps, SelectIconState, SelectIconExposes>

SelectPortal#

Props#

Defines valid properties in SelectPortal component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
style(CSSProperties | ((instance?: PortalInstance) => CSSProperties)) & (CSSProperties | ((instance?: SelectPortalInstance) => CSSProperties))
null
The style to apply to the component.
className(string | ((instance?: PortalInstance) => string)) & (string | ((instance?: SelectPortalInstance) => string))
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptPortalPassThrough & Record<PropertyKey, unknown> & SelectPortalPassThrough
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
children(ReactNode | ((instance: PortalInstance) => ReactNode)) & (ReactNode | ((instance: SelectPortalInstance) => ReactNode))
null
The children to render.
elementReactNode
null
The element to be rendered as the portal.
appendToHTMLElement | "body" | "self"
'body'
The DOM element where the portal should be appended to.
visibleboolean
false
Whether the portal is visible or not.
onMounted() => void
null
Callback function to invoke when the portal is mounted.
onUnmounted() => void
null
Callback function to invoke when the portal is unmounted.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectPortal component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.

Interfaces#

Defines passthrough(pt) options of SelectPortal component.

nametypedefaultdescription
rootSelectPortalPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SelectPortal component.

values
ComponentInstance<SelectPortalProps, SelectPortalState, SelectPortalExposes>

SelectList#

Props#

Defines valid properties in SelectList component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectListInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectListInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectListPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectListInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectList component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.

Interfaces#

Defines passthrough(pt) options of SelectList component.

nametypedefaultdescription
rootSelectListPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SelectList component.

values
ComponentInstance<SelectListProps, SelectListState, SelectListExposes>

SelectOptions#

Props#

Defines valid properties in SelectOptions component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectOptionsInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectOptionsInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectOptionsPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectOptionsInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectOptions component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.
listboxListboxRootInstance
null
The Listbox component instance.

Interfaces#

Defines passthrough(pt) options of SelectOptions component.

nametypedefaultdescription
rootSelectOptionsPassThroughType<HTMLAttributes<HTMLUListElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SelectOptions component.

values
ComponentInstance<SelectOptionsProps, SelectOptionsState, SelectOptionsExposes>

SelectOption#

Props#

Defines valid properties in SelectOption component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectOptionInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectOptionInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectOptionPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectOptionInstance) => ReactNode)
null
The children to render.
optionunknown
null
The option data object.
indexnumber
null
The index of the option in the list.
selectedboolean
null
Whether the option is selected.
focusedboolean
null
Whether the option is focused.
disabledboolean
null
Whether the option is disabled.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectOption component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.
listboxListboxRootInstance
null
The Listbox component instance.
optionInstanceListboxOptionInstance
null
The ListboxOption component instance.
optionunknown
null
The option data object.
indexnumber
null
The index of the option.
groupboolean
null
Whether this is a group header option.
selectedboolean
null
Whether the option is selected.

Interfaces#

Defines passthrough(pt) options of SelectOption component.

nametypedefaultdescription
rootSelectOptionPassThroughType<HTMLAttributes<HTMLLIElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SelectOption component.

values
ComponentInstance<SelectOptionProps, SelectOptionState, SelectOptionExposes>

SelectClearIcon#

Props#

Defines valid properties in SelectClearIcon component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectClearIconInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectClearIconInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectClearIconPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectClearIconInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectClearIcon component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.

Interfaces#

Defines passthrough(pt) options of SelectClearIcon component.

nametypedefaultdescription
rootSelectClearIconPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SelectClearIcon component.

values
ComponentInstance<SelectClearIconProps, SelectClearIconState, SelectClearIconExposes>

SelectSelection#

Props#

Defines valid properties in SelectSelection component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectSelectionInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectSelectionInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectSelectionPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectSelectionInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectSelection component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.
listboxListboxRootInstance
null
The Listbox component instance.

Interfaces#

Defines passthrough(pt) options of SelectSelection component.

nametypedefaultdescription
rootSelectSelectionPassThroughType<HTMLAttributes<HTMLElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SelectSelection component.

values
ComponentInstance<SelectSelectionProps, SelectSelectionState, SelectSelectionExposes>

SelectFilter#

Props#

Defines valid properties in SelectFilter component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectFilterInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectFilterInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectFilterPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectFilterInstance) => ReactNode)
null
The children to render.
placeholderstring
null
Placeholder text for the filter input.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectFilter component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.

Interfaces#

Defines passthrough(pt) options of SelectFilter component.

nametypedefaultdescription
rootSelectFilterPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.
inputSelectFilterPassThroughType<HTMLAttributes<HTMLInputElement>>
null
Used to pass attributes to the input's DOM element.

Types#

Instance of SelectFilter component.

values
ComponentInstance<SelectFilterProps, SelectFilterState, SelectFilterExposes>

SelectHeader#

Props#

Defines valid properties in SelectHeader component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectHeaderInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectHeaderInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectHeaderPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectHeaderInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectHeader component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.

Interfaces#

Defines passthrough(pt) options of SelectHeader component.

nametypedefaultdescription
rootSelectHeaderPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SelectHeader component.

values
ComponentInstance<SelectHeaderProps, SelectHeaderState, SelectHeaderExposes>

SelectFooter#

Props#

Defines valid properties in SelectFooter component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectFooterInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectFooterInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectFooterPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectFooterInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectFooter component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.

Interfaces#

Defines passthrough(pt) options of SelectFooter component.

nametypedefaultdescription
rootSelectFooterPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SelectFooter component.

values
ComponentInstance<SelectFooterProps, SelectFooterState, SelectFooterExposes>

SelectEmpty#

Props#

Defines valid properties in SelectEmpty component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SelectEmptyInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SelectEmptyInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SelectEmptyPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SelectEmptyInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SelectEmpty component.

nametypedefaultdescription
selectSelectRootInstance
null
The Select component instance.

Interfaces#

Defines passthrough(pt) options of SelectEmpty component.

nametypedefaultdescription
rootSelectEmptyPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SelectEmpty component.

values
ComponentInstance<SelectEmptyProps, SelectEmptyState, SelectEmptyExposes>

useSelect#

Props#

Props for the useSelect hook.

nametypedefaultdescription
valueunknown
null
The current selected value of the select.
defaultValueunknown
null
The default selected value when used in uncontrolled mode.
filterValuestring
null
The current filter text value (controlled).
defaultFilterValuestring
null
The default filter text value when used in uncontrolled mode.
openboolean
null
Controlled open state of the select overlay.
defaultOpenboolean
null
Default open state for uncontrolled mode.
optionsunknown[]
null
An array of options to display.
optionKeystring
null
Unique key for each option.
optionLabelstring
null
Label field for each option.
optionValuestring
null
Value field for each option.
optionDisabledstring
null
Field to check if an option is disabled.
optionGroupLabelstring
null
Label field for option groups.
optionGroupChildrenstring
null
Field that contains the children options in a group.
disabledboolean
null
When present, it specifies that the component should be disabled.
localestring
null
The locale to use for localization.
autoOptionFocusboolean
null
When enabled, the focused option is automatically highlighted.
selectOnFocusboolean
null
When enabled, the focused option is automatically selected.
focusOnHoverboolean
null
When enabled, the focused option changes on hover.
multipleboolean
null
When enabled, allows multiple items to be selected.
filterboolean
null
When enabled, displays a filter input in the dropdown.
filterMatchMode"endsWith" | "startsWith" | "contains" | "equals"
null
Defines how the filter should match options.
appendToHTMLElement | "body" | "self"
null
A valid query selector or an HTMLElement to specify where the overlay gets attached.
ariaLabelstring
null
Used to define a string that labels the input element.
ariaLabelledBystring
null
Identifier of the underlying input element.
onValueChange(event: useSelectValueChangeEvent) => void
null
Callback to invoke when the selected value changes.
onFilterValueChange(event: useSelectFilterValueChangeEvent) => void
null
Callback when the filter value changes.
onOpenChange(event: useSelectOpenChangeEvent) => void
null
Callback to invoke when the open state changes.

State#

Defines valid state in useSelect.

nametypedefaultdescription
valueunknown
null
The current selected value.
filterValuestring
null
The current filter text value.
openedboolean
null
Whether the overlay is open.
focusedboolean
null
Whether the trigger is focused.
focusedOptionIndexnumber
null
The index of the currently focused option. -1 if no option is focused.
anchorElHTMLElement
null
The anchor (trigger) element.
positionerElHTMLDivElement
null
The positioner element.

Exposes#

Defines the methods and properties exposed by useSelect.

nametypedefaultdescription
stateuseSelectState
null
The state of the useSelect.
listboxuseListboxInstance
null
The listbox instance used internally for option management.
presence{ present: boolean; exiting: boolean; mounted: boolean; ref: RefObject<HTMLElement> }
null
The presence state for managing mount/unmount transitions.
triggerRefRefObject<HTMLElement>
null
Reference to the trigger element.
setAnchorRef(node: HTMLElement) => void
null
Sets the anchor (trigger) element reference.
setPositionerRef(node: HTMLDivElement) => void
null
Sets the positioner element reference.
onContainerClick(event: MouseEvent<HTMLDivElement>) => void
null
Callback when the container is clicked.
onKeyDown(event: KeyboardEvent<HTMLElement>) => void
null
Callback when a key is pressed on the trigger.
onFilterKeyDown(event: KeyboardEvent<HTMLInputElement>) => void
null
Callback when a key is pressed in the filter input.
onClearClick(event: MouseEvent<HTMLButtonElement>) => void
null
Callback when the clear button is clicked.
onOptionSelect(event: { originalEvent: SyntheticEvent; value: unknown }) => void
null
Callback when an option is selected.
getFocusedOptionId() => string
null
Gets the ID of the currently focused option for aria-activedescendant.
getSelectedOptionLabel() => unknown
null
Gets the label of the currently selected option.
hasValue() => boolean
null
Checks if there is a selected value.
show() => void
null
Shows the overlay.
hide() => void
null
Hides the overlay.
toggle(event: SyntheticEvent) => void
null
Toggles the overlay visibility.

Events#

Event fired when the select's value changes.

nametypedescription
originalEventEThe original event that triggered the change.
valueunknownThe selected value.
optionunknownThe selected option object.

Event object for the onOpenChange callback.

nametypedescription
valuebooleanThe new value of the select's open state.

Event fired when the select's filter value changes.

nametypedescription
originalEventEThe original event that triggered the change.
querystringThe current filter query.

Types#

Instance of useSelect headless.

values
HeadlessInstance<useSelectProps, useSelectState, useSelectExposes>