Select
A common form component for choosing a predefined value in a dropdown menu.
View as MarkdownUsage guidelines
- Prefer Combobox for large lists: Select is not filterable, aside from basic keyboard typeahead functionality to find items by focusing and highlighting them. Prefer Combobox instead of Select when the number of items is sufficiently large to warrant filtering.
- Special positioning behavior: The select popup by default overlaps its trigger so the selected item’s text is aligned with the trigger’s value text. This behavior can be disabled or customized.
- Form controls must have an accessible name: It can be created using the
Fieldcomponent. See Labeling a select and the forms guide.
Anatomy
Import the component and assemble its parts:
import { Select } from '@base-ui/react/select';
<Select.Root>
<Select.Trigger>
<Select.Value />
<Select.Icon />
</Select.Trigger>
<Select.Portal>
<Select.Backdrop />
<Select.Positioner>
<Select.ScrollUpArrow />
<Select.Popup>
<Select.Arrow />
<Select.List>
<Select.Item>
<Select.ItemText />
<Select.ItemIndicator />
</Select.Item>
<Select.Separator />
<Select.Group>
<Select.GroupLabel />
</Select.Group>
</Select.List>
</Select.Popup>
<Select.ScrollDownArrow />
</Select.Positioner>
</Select.Portal>
</Select.Root>Positioning
<Select.Positioner> has a special prop called alignItemWithTrigger which causes the positioning to act differently by default from other Positioner components.
The prop makes the select popup overlap the trigger so the selected item’s text is aligned with the trigger’s value text.
For styling, data-side is "none" on the .Popup and .Positioner parts when the mode is active.
To prevent the select popup from overlapping its trigger, set the alignItemWithTrigger prop to false.
When set to true (its default) there are a few important points to note about its behavior:
- Interaction type dependent: For UX reasons, the
alignItemWithTriggerpositioning mode is disabled if touch was the pointer type used to open the popup. - Viewport space dependent: There must be enough space in the viewport to align the selected item’s text with the trigger’s value text without causing the popup to be too vertically small — otherwise, it falls back to the default positioning mode.
This can be customized by setting
min-heighton the<Select.Positioner>element; a smaller value will fallback less often. Additionally, the trigger must be at least 20px from the edges of the top and bottom of the viewport, or it will also fall back. - Other positioning props are ignored: Props like
sideoralignhave no effect unless the prop is set tofalseor when in fallback mode.
Examples
Typed wrapper component
The following example shows a typed wrapper around the Select component with correct type inference and type safety:
import * as React from 'react';
import { Select } from '@base-ui/react/select';
export function MySelect<Value, Multiple extends boolean | undefined = false>(
props: Select.Root.Props<Value, Multiple>,
): React.JSX.Element {
return <Select.Root {...props}>{/* ... */}</Select.Root>;
}Formatting the value
By default, the <Select.Value> component renders the raw value.
Passing the items prop to <Select.Root> instead renders the matching label for the rendered value:
const items = [
{ value: null, label: 'Select theme' },
{ value: 'system', label: 'System default' },
{ value: 'light', label: 'Light' },
{ value: 'dark', label: 'Dark' },
];
<Select.Root items={items}>
<Select.Value />
</Select.Root>A function can also be passed as the children prop of <Select.Value> to render a formatted value:
const items = {
monospace: 'Monospace',
serif: 'Serif',
'san-serif': 'Sans-serif',
};
<Select.Value>
{(value: keyof typeof items) => (
<span style={{ fontFamily: value }}>
{items[value]}
</span>
)}
</Select.Value>To avoid lookup, object values for each item can also be used.
Labeling a select
Use the Field component to provide a visible label for the select trigger:
<Field.Root>
<Field.Label nativeLabel={false} render={<div />}>
Theme
</Field.Label>
<Select.Root>{/* ... */}</Select.Root>
</Field.Root>Replace the rendered <label> element with a <div> element and add nativeLabel={false} so it does not inherit native label behaviors. This ensures clicking on the label will focus the select trigger without opening the associated popup to match native <select> behavior, and prevents CSS :hover from activating on the trigger when hovering over the label.
Placeholder values
To show a placeholder value, use the placeholder prop on <Select.Value>:
const items = [
{ value: 'system', label: 'System default' },
{ value: 'light', label: 'Light' },
{ value: 'dark', label: 'Dark' },
];
<Select.Root items={items}>
<Select.Value placeholder="Select theme" />
</Select.Root>With placeholders, users cannot clear selected values using the select itself. If the select value should be clearable from the popup (instead of an external “reset” button), use a null item rendered in the list itself:
const items = [
{ value: null, label: 'Select theme' },
{ value: 'system', label: 'System default' },
{ value: 'light', label: 'Light' },
{ value: 'dark', label: 'Dark' },
];
<Select.Root items={items}>
<Select.Value />
</Select.Root>Multiple selection
Add the multiple prop to the <Select.Root> component to allow multiple selections.
Object values
Select items can use objects as values instead of primitives.
This lets you access the full object in custom render functions, and can avoid needing to specify items for lookup.
API reference
Root
Groups all parts of the select. Doesn’t render its own HTML element.
namestring—
string- Name
- Description
Identifies the field when a form is submitted.
- Type
string | undefined
defaultValueUnion—
Union- Name
- Description
The uncontrolled value of the select when it’s initially rendered.
To render a controlled select, use the
valueprop instead.- Type
Value[] | Value | null | undefined
valueUnion—
Union- Name
- Description
The value of the select. Use when controlled.
- Type
Value[] | Value | null | undefined
onValueChangefunction—
function- Name
- Description
Event handler called when the value of the select changes.
- Type
| (( value: Value[] | Value | any | null, eventDetails: Select.Root.ChangeEventDetails, ) => void) | undefined
defaultOpenbooleanfalse
boolean- Name
- Description
Whether the select popup is initially open.
To render a controlled select popup, use the
openprop instead.- Type
boolean | undefined- Default
false
openboolean—
boolean- Name
- Description
Whether the select popup is currently open.
- Type
boolean | undefined
onOpenChangefunction—
function- Name
- Description
Event handler called when the select popup is opened or closed.
- Type
| (( open: boolean, eventDetails: Select.Root.ChangeEventDetails, ) => void) | undefined
highlightItemOnHoverbooleantrue
boolean- Description
Whether moving the pointer over items should highlight them. Disabling this prop allows CSS
:hoverto be differentiated from the:focus(data-highlighted) state.- Type
boolean | undefined- Default
true
actionsRef| React.RefObject<Select.Root.Actions
| null>—
| React.RefObject<Select.Root.Actions
| null>- Name
- Description
A ref to imperative actions.
unmount: When specified, the select will not be unmounted when closed. Instead, theunmountfunction must be called to unmount the select manually. Useful when the select’s animation is controlled by an external library.
- Type
React.RefObject<Select.Root.Actions | null> | undefined
autoCompletestring—
string- Name
- Description
Provides a hint to the browser for autofill.
- Type
string | undefined
isItemEqualToValuefunction—
function- Description
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.iscomparison.- Type
((itemValue: Value, value: Value) => boolean) | undefined
itemToStringLabelfunction—
function- Description
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.- Type
((itemValue: Value) => string) | undefined
itemToStringValuefunction—
function- Description
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.- Type
((itemValue: Value) => string) | undefined
itemsUnion—
Union- Name
- Description
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.- Type
| Record<string, React.ReactNode> | { label: React.ReactNode; value: any }[] | undefined- Example
const items = { sans: 'Sans-serif', serif: 'Serif', mono: 'Monospace', cursive: 'Cursive', }; <Select.Root items={items} />
modalbooleantrue
boolean- Name
- Description
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.
- Type
boolean | undefined- Default
true
multiplebooleanfalse
boolean- Name
- Description
Whether multiple items can be selected.
- Type
boolean | undefined- Default
false
onOpenChangeCompletefunction—
function- Description
Event handler called after any animations complete when the select popup is opened or closed.
- Type
((open: boolean) => void) | undefined
disabledbooleanfalse
boolean- Name
- Description
Whether the component should ignore user interaction.
- Type
boolean | undefined- Default
false
readOnlybooleanfalse
boolean- Name
- Description
Whether the user should be unable to choose a different option from the select popup.
- Type
boolean | undefined- Default
false
requiredbooleanfalse
boolean- Name
- Description
Whether the user must choose a value before submitting a form.
- Type
boolean | undefined- Default
false
inputRefReact.Ref<HTMLInputElement>—
React.Ref<HTMLInputElement>- Name
- Description
A ref to access the hidden input element.
- Type
React.Ref<HTMLInputElement> | undefined
idstring—
string- Name
- Description
The id of the Select.
- Type
string | undefined
childrenReact.ReactNode—
React.ReactNode- Name
- Type
React.ReactNode | undefined
Additional Types
Select.Root.Props
Re-Export of Root props as SelectRootProps
Select.Root.State
type SelectRootState = {};Select.Root.Actions
type SelectRootActions = { unmount: () => void };Select.Root.ChangeEventReason
type SelectRootChangeEventReason =
| 'trigger-press'
| 'outside-press'
| 'escape-key'
| 'window-resize'
| 'item-press'
| 'focus-out'
| 'list-navigation'
| 'cancel-open'
| 'none';Select.Root.ChangeEventDetails
type SelectRootChangeEventDetails =
| {
reason: 'trigger-press';
event: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
cancel: () => void;
allowPropagation: () => void;
isCanceled: boolean;
isPropagationAllowed: boolean;
trigger: Element | undefined;
}
| {
reason: 'outside-press';
event: MouseEvent | PointerEvent | TouchEvent;
cancel: () => void;
allowPropagation: () => void;
isCanceled: boolean;
isPropagationAllowed: boolean;
trigger: Element | undefined;
}
| {
reason: 'escape-key';
event: KeyboardEvent;
cancel: () => void;
allowPropagation: () => void;
isCanceled: boolean;
isPropagationAllowed: boolean;
trigger: Element | undefined;
}
| {
reason: 'window-resize';
event: UIEvent;
cancel: () => void;
allowPropagation: () => void;
isCanceled: boolean;
isPropagationAllowed: boolean;
trigger: Element | undefined;
}
| {
reason: 'item-press';
event: MouseEvent | PointerEvent | KeyboardEvent;
cancel: () => void;
allowPropagation: () => void;
isCanceled: boolean;
isPropagationAllowed: boolean;
trigger: Element | undefined;
}
| {
reason: 'focus-out';
event: KeyboardEvent | FocusEvent;
cancel: () => void;
allowPropagation: () => void;
isCanceled: boolean;
isPropagationAllowed: boolean;
trigger: Element | undefined;
}
| {
reason: 'list-navigation';
event: KeyboardEvent;
cancel: () => void;
allowPropagation: () => void;
isCanceled: boolean;
isPropagationAllowed: boolean;
trigger: Element | undefined;
}
| {
reason: 'cancel-open';
event: MouseEvent;
cancel: () => void;
allowPropagation: () => void;
isCanceled: boolean;
isPropagationAllowed: boolean;
trigger: Element | undefined;
}
| {
reason: 'none';
event: Event;
cancel: () => void;
allowPropagation: () => void;
isCanceled: boolean;
isPropagationAllowed: boolean;
trigger: Element | undefined;
};Trigger
A button that opens the select popup.
Renders a <button> element.
nativeButtonbooleantrue
boolean- Name
- Description
Whether the component renders a native
<button>element when replacing it via therenderprop. Set tofalseif the rendered element is not a button (for example,<div>).- Type
boolean | undefined- Default
true
disabledboolean—
boolean- Name
- Description
Whether the component should ignore user interaction.
- Type
boolean | undefined
childrenReact.ReactNode—
React.ReactNode- Name
- Type
React.ReactNode | undefined
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.Trigger.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.Trigger.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.Trigger.State, ) => ReactElement) | undefined
data-popup-open
data-pressed
data-disabled
data-readonly
data-required
data-valid
data-invalid
data-dirty
data-touched
data-filled
data-focused
data-placeholder
Additional Types
Select.Trigger.Props
Re-Export of Trigger props as SelectTriggerProps
Select.Trigger.State
type SelectTriggerState = {
open: boolean;
readOnly: boolean;
value: any;
placeholder: boolean;
disabled: boolean;
touched: boolean;
dirty: boolean;
valid: boolean | null;
filled: boolean;
focused: boolean;
};Value
A text label of the currently selected item.
Renders a <span> element.
placeholderReact.ReactNode—
React.ReactNode- Name
- Description
The placeholder value to display when no value is selected. This is overridden by
childrenif specified, or by a null item’s label initems.- Type
React.ReactNode | undefined
children| React.ReactNode
| ((value: any) => React.ReactNode)—
| React.ReactNode
| ((value: any) => React.ReactNode)- Name
- Description
Accepts a function that returns a
ReactNodeto format the selected value.- Type
React.ReactNode | ((value: any) => React.ReactNode) | undefined- Example
<Select.Value> {(value: string | null) => value ? labels[value] : 'No value'} </Select.Value>
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.Value.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.Value.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.Value.State, ) => ReactElement) | undefined
data-placeholder
Additional Types
Select.Value.Props
Re-Export of Value props as SelectValueProps
Select.Value.State
type SelectValueState = { value: any; placeholder: boolean };Icon
An icon that indicates that the trigger button opens a select popup.
Renders a <span> element.
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.Icon.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.Icon.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.Icon.State, ) => ReactElement) | undefined
data-popup-open
Additional Types
Select.Icon.Props
Re-Export of Icon props as SelectIconProps
Select.Icon.State
type SelectIconState = { open: boolean };Backdrop
An overlay displayed beneath the menu popup.
Renders a <div> element.
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.Backdrop.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.Backdrop.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.Backdrop.State, ) => ReactElement) | undefined
data-open
data-closed
data-starting-style
data-ending-style
Additional Types
Select.Backdrop.Props
Re-Export of Backdrop props as SelectBackdropProps
Select.Backdrop.State
type SelectBackdropState = { open: boolean; transitionStatus: TransitionStatus };Portal
A portal element that moves the popup to a different part of the DOM.
By default, the portal element is appended to <body>.
Renders a <div> element.
containerUnion—
Union- Name
- Description
A parent element to render the portal element into.
- Type
| HTMLElement | ShadowRoot | React.RefObject<HTMLElement | ShadowRoot | null> | null | undefined
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.Portal.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.Portal.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.Portal.State, ) => ReactElement) | undefined
Additional Types
Select.Portal.Props
Re-Export of Portal props as SelectPortalProps
Select.Portal.State
type SelectPortalState = {};Positioner
Positions the select popup.
Renders a <div> element.
alignItemWithTriggerbooleantrue
boolean- Description
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.
- Type
boolean | undefined- Default
true
disableAnchorTrackingbooleanfalse
boolean- Description
Whether to disable the popup from tracking any layout shift of its positioning anchor.
- Type
boolean | undefined- Default
false
alignAlign'center'
Align- Name
- Description
How to align the popup relative to the specified side.
- Type
'start' | 'center' | 'end' | undefined- Default
'center'
alignOffsetnumber | OffsetFunction0
number | OffsetFunction- Name
- Description
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
dataobject 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.
- Type
| number | ((data: { side: | 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'; align: 'start' | 'center' | 'end'; anchor: { width: number; height: number }; positioner: { width: number; height: number }; }) => number) | undefined- Default
0- Example
<Positioner alignOffset={({ side, align, anchor, positioner }) => { return side === 'top' || side === 'bottom' ? anchor.width : anchor.height; }} />
sideSide'bottom'
Side- Name
- Description
Which side of the anchor element to align the popup against. May automatically change to avoid collisions.
- Type
| 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | undefined- Default
'bottom'
sideOffsetnumber | OffsetFunction0
number | OffsetFunction- Name
- Description
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
dataobject 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.
- Type
| number | ((data: { side: | 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'; align: 'start' | 'center' | 'end'; anchor: { width: number; height: number }; positioner: { width: number; height: number }; }) => number) | undefined- Default
0- Example
<Positioner sideOffset={({ side, align, anchor, positioner }) => { return side === 'top' || side === 'bottom' ? anchor.height : anchor.width; }} />
arrowPaddingnumber5
number- Name
- Description
Minimum distance to maintain between the arrow and the edges of the popup.
Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
- Type
number | undefined- Default
5
anchorUnion—
Union- Name
- Description
An element to position the popup against. By default, the popup will be positioned against the trigger.
- Type
| Element | VirtualElement | React.RefObject<Element | null> | (() => Element | VirtualElement | null) | null | undefined
collisionAvoidanceCollisionAvoidance—
CollisionAvoidance- Description
Determines how to handle collisions when positioning the popup.
- Type
CollisionAvoidance | undefined- Example
<Positioner collisionAvoidance={{ side: 'shift', align: 'shift', fallbackAxisSide: 'none', }} />
collisionBoundaryBoundary'clipping-ancestors'
Boundary- Description
An element or a rectangle that delimits the area that the popup is confined to.
- Type
Boundary | undefined- Default
'clipping-ancestors'
collisionPaddingPadding5
Padding- Name
- Description
Additional space to maintain from the edge of the collision boundary.
- Type
Padding | undefined- Default
5
stickybooleanfalse
boolean- Name
- Description
Whether to maintain the popup in the viewport after the anchor element was scrolled out of view.
- Type
boolean | undefined- Default
false
positionMethod'absolute' | 'fixed''absolute'
'absolute' | 'fixed'- Name
- Description
Determines which CSS
positionproperty to use.- Type
'absolute' | 'fixed' | undefined- Default
'absolute'
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.Positioner.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.Positioner.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.Positioner.State, ) => ReactElement) | undefined
data-open
data-closed
data-anchor-hidden
data-align
data-side
--anchor-height
The anchor’s height.
--anchor-width
The anchor’s width.
--available-height
The available height between the trigger and the edge of the viewport.
--available-width
The available width between the trigger and the edge of the viewport.
--transform-origin
The coordinates that this element is anchored to. Used for animations and transitions.
Additional Types
Select.Positioner.Props
Re-Export of Positioner props as SelectPositionerProps
Select.Positioner.State
type SelectPositionerState = {
open: boolean;
side:
| 'top'
| 'bottom'
| 'left'
| 'right'
| 'inline-end'
| 'inline-start'
| 'none';
align: 'start' | 'center' | 'end';
anchorHidden: boolean;
}Popup
A container for the select list.
Renders a <div> element.
finalFocusUnion—
Union- Name
- Description
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.
- Type
| boolean | React.RefObject<HTMLElement | null> | (( closeType: | 'mouse' | 'touch' | 'pen' | 'keyboard' | '', ) => boolean | void | HTMLElement | null) | undefined
childrenReact.ReactNode—
React.ReactNode- Name
- Type
React.ReactNode | undefined
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.Popup.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.Popup.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.Popup.State, ) => ReactElement) | undefined
data-open
data-closed
data-align
data-side
data-starting-style
data-ending-style
Additional Types
Select.Popup.Props
Re-Export of Popup props as SelectPopupProps
Select.Popup.State
type SelectPopupState = {
side:
| 'top'
| 'bottom'
| 'left'
| 'right'
| 'inline-end'
| 'inline-start'
| 'none';
align: 'start' | 'center' | 'end';
open: boolean;
transitionStatus: TransitionStatus;
}List
A container for the select items.
Renders a <div> element.
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.List.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.List.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.List.State, ) => ReactElement) | undefined
Additional Types
Select.List.Props
Re-Export of List props as SelectListProps
Select.List.State
type SelectListState = {};Arrow
Displays an element positioned against the select popup anchor.
Renders a <div> element.
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.Arrow.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.Arrow.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.Arrow.State, ) => ReactElement) | undefined
data-open
data-closed
data-uncentered
data-align
data-side
Additional Types
Select.Arrow.Props
Re-Export of Arrow props as SelectArrowProps
Select.Arrow.State
type SelectArrowState = {
open: boolean;
side:
| 'top'
| 'bottom'
| 'left'
| 'right'
| 'inline-end'
| 'inline-start'
| 'none';
align: 'start' | 'center' | 'end';
uncentered: boolean;
}Item
An individual option in the select popup.
Renders a <div> element.
labelstring—
string- Name
- Description
Specifies the text label to use when the item is matched during keyboard text navigation.
Defaults to the item text content if not provided.
- Type
string | undefined
valueanynull
any- Name
- Description
A unique value that identifies this select item.
- Type
any | undefined- Default
null
nativeButtonbooleanfalse
boolean- Name
- Description
Whether the component renders a native
<button>element when replacing it via therenderprop. Set totrueif the rendered element is a native button.- Type
boolean | undefined- Default
false
disabledbooleanfalse
boolean- Name
- Description
Whether the component should ignore user interaction.
- Type
boolean | undefined- Default
false
childrenReact.ReactNode—
React.ReactNode- Name
- Type
React.ReactNode | undefined
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.Item.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.Item.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.Item.State, ) => ReactElement) | undefined
data-selected
data-highlighted
data-disabled
Additional Types
Select.Item.Props
Re-Export of Item props as SelectItemProps
Select.Item.State
type SelectItemState = { disabled: boolean; selected: boolean; highlighted: boolean };ItemText
A text label of the select item.
Renders a <div> element.
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.ItemText.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.ItemText.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.ItemText.State, ) => ReactElement) | undefined
Additional Types
Select.ItemText.Props
Re-Export of ItemText props as SelectItemTextProps
Select.ItemText.State
type SelectItemTextState = {};ItemIndicator
Indicates whether the select item is selected.
Renders a <span> element.
childrenReact.ReactNode—
React.ReactNode- Name
- Type
React.ReactNode | undefined
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | (( state: Select.ItemIndicator.State, ) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.ItemIndicator.State, ) => React.CSSProperties | undefined) | undefined
keepMountedboolean—
boolean- Name
- Description
Whether to keep the HTML element in the DOM when the item is not selected.
- Type
boolean | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.ItemIndicator.State, ) => ReactElement) | undefined
Additional Types
Select.ItemIndicator.Props
Re-Export of ItemIndicator props as SelectItemIndicatorProps
Select.ItemIndicator.State
type SelectItemIndicatorState = { selected: boolean; transitionStatus: TransitionStatus };Group
Groups related select items with the corresponding label.
Renders a <div> element.
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.Group.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.Group.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.Group.State, ) => ReactElement) | undefined
Additional Types
Select.Group.Props
Re-Export of Group props as SelectGroupProps
Select.Group.State
type SelectGroupState = {};GroupLabel
An accessible label that is automatically associated with its parent group.
Renders a <div> element.
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: Select.GroupLabel.State) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.GroupLabel.State, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.GroupLabel.State, ) => ReactElement) | undefined
Additional Types
Select.GroupLabel.Props
Re-Export of GroupLabel props as SelectGroupLabelProps
Select.GroupLabel.State
type SelectGroupLabelState = {};ScrollUpArrow
An element that scrolls the select popup up when hovered. Does not render when using touch input.
Renders a <div> element.
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | (( state: Select.ScrollUpArrow.State, ) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.ScrollUpArrow.State, ) => React.CSSProperties | undefined) | undefined
keepMountedbooleanfalse
boolean- Name
- Description
Whether to keep the HTML element in the DOM while the select popup is not scrollable.
- Type
boolean | undefined- Default
false
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.ScrollUpArrow.State, ) => ReactElement) | undefined
data-direction
data-side
data-visible
data-starting-style
data-ending-style
Additional Types
Select.ScrollUpArrow.Props
Re-Export of ScrollUpArrow props as SelectScrollUpArrowProps
Select.ScrollUpArrow.State
type SelectScrollUpArrowState = {};ScrollDownArrow
An element that scrolls the select popup down when hovered. Does not render when using touch input.
Renders a <div> element.
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | (( state: Select.ScrollDownArrow.State, ) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: Select.ScrollDownArrow.State, ) => React.CSSProperties | undefined) | undefined
keepMountedbooleanfalse
boolean- Name
- Description
Whether to keep the HTML element in the DOM while the select popup is not scrollable.
- Type
boolean | undefined- Default
false
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: Select.ScrollDownArrow.State, ) => ReactElement) | undefined
data-direction
data-side
data-visible
data-starting-style
data-ending-style
Additional Types
Select.ScrollDownArrow.Props
Re-Export of ScrollDownArrow props as SelectScrollDownArrowProps
Select.ScrollDownArrow.State
type SelectScrollDownArrowState = {};Separator
A separator element accessible to screen readers.
Renders a <div> element.
orientationOrientation'horizontal'
Orientation- Name
- Description
The orientation of the separator.
- Type
'horizontal' | 'vertical' | undefined- Default
'horizontal'
classNamestring | function—
string | function- Name
- Description
CSS class applied to the element, or a function that returns a class based on the component’s state.
- Type
| string | ((state: SeparatorState) => string | undefined) | undefined
styleReact.CSSProperties | function—
React.CSSProperties | function- Name
- Type
| React.CSSProperties | (( state: SeparatorState, ) => React.CSSProperties | undefined) | undefined
renderReactElement | function—
ReactElement | function- Name
- Description
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.
Accepts a
ReactElementor a function that returns the element to render.- Type
| ReactElement | (( props: HTMLProps, state: SeparatorState, ) => ReactElement) | undefined
Additional Types
Select.Separator.Props
Re-Export of Separator props as SelectSeparatorProps
Select.Separator.State
type SelectSeparatorState = {
orientation: 'horizontal' | 'vertical';
}