Skip to content

Select

A closed, scannable list that chooses one or more values without text entry.

Response language
hero.tsx

Usage guidelines

  • Use Select to choose from a closed list the user can scan. Use Combobox when the list needs search, Autocomplete for free text with suggestions, and RadioGroup or SegmentedControl when every option should stay visible.
  • Give the trigger an accessible name: a visible SelectLabel, a field label, or aria-label when the surrounding layout already labels it visually.
  • Pass items to the root so SelectValue renders the label of the selected value, including before the popup first opens.
  • Keep the caller's value type. Select<Value> infers it from value, defaultValue and items; do not widen a union of IDs to string.
  • SelectContent is at least as wide as the trigger and clamps to the viewport with Base UI's --anchor-width and --available-width. Do not replace that sizing with a fixed width.

Anatomy

tsx
tsx

SelectContent bundles the portal, positioner, popup and scrollable list. Compose SelectPortal, SelectPositioner, SelectPopup and SelectList directly only when a surface needs positioning beyond side, align and their offsets.

Examples

Multiple selection

Pass multiple to choose more than one option from the list; the popup stays open as you toggle items. Type SelectValue<Value, true> to format the read-only array and provide placeholder text when nothing is selected.

Allowed file types
multiple.tsx

Sizes

SelectTrigger supports small, medium (default) and large sizes.

Small
Medium
Large
sizes.tsx

Groups and disabled items

Group related items under a SelectGroupLabel and divide groups with SelectSeparator. A disabled item stays visible and can be highlighted, but not selected.

Default model
groups.tsx

Typed controlled value

Control the value with value and onValueChange when another part of the page reads it. The value keeps its domain type.

Deployment region

Deploying to US East (Virginia) (us-east)

typed-value.tsx

Keyboard

KeyAction
EnterorSpaceorDown arroworUp arrowOpens the popup from the trigger and highlights the selected item.
Down arroworUp arrowMoves the highlight between items.
HomeorEndHighlights the first or last item.
Printable charactersHighlights the next matching item; on a closed trigger, selects it.
EnterorSpaceSelects the highlighted item and closes the popup.
EscapeCloses the popup and returns focus to the trigger.

API reference

Select

Groups all parts of a single- or multiple-value select dropdown. Doesn't render its own HTML element.

Base UI Select.Root docs

SelectContent

A styled select popup bundled with a portal, positioner, and scrollable list. Renders a <div> element.

Base UI Select.Popup docs

Props
PropTypeDefaultDetails
align'center' | 'end' | 'start''start'
sideOffsetnumber | OffsetFunction4
children requiredReact.ReactNodeNo default
Base UI Select.Popup docs
Data attributes
AttributeDescription
data-open

Present when the select is open.

data-closed

Present when the select is closed.

data-starting-style

Present when the select begins animating in.

data-ending-style

Present when the select is animating out.

data-side

Values: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'

Indicates which side the popup is positioned relative to the trigger.

data-align

Values: 'start' | 'center' | 'end'

Indicates how the popup is aligned relative to specified side.

CSS variables
VariableDescription
--available-width

Values: number

The available width between the trigger and the edge of the viewport.

--available-height

Values: number

The available height between the trigger and the edge of the viewport.

--anchor-width

Values: number

The anchor's width.

--anchor-height

Values: number

The anchor's height.

--transform-origin

Values: string

The coordinates that this element is anchored to. Used for animations and transitions.

SelectGroup

Groups related select items with the corresponding label. Renders a <div> element.

Base UI Select.Group docs

SelectGroupLabel

An accessible label that is automatically associated with its parent group. Renders a <div> element.

Base UI Select.GroupLabel docs

SelectItem

An individual option in the select popup. Renders a <div> element.

Base UI Select.Item docs

Props
PropTypeDefaultDetails
valueValueNo default
Base UI Select.Item docs
Data attributes
AttributeDescription
data-selected

Present when the select item is selected.

data-highlighted

Present when the select item is highlighted.

data-disabled

Present when the select item is disabled.

SelectItemIndicator

Indicates whether the select item is selected. Renders a <span> element.

Base UI Select.ItemIndicator docs

Data attributes
AttributeDescription
data-starting-style

Present when the indicator begins animating in.

data-ending-style

Present when the indicator is animating out.

SelectItemText

A text label of the select item. Renders a <div> element.

Base UI Select.ItemText docs

SelectLabel

An accessible label that is automatically associated with the select trigger. Renders a <div> element.

Base UI Select.Label docs

Data attributes
AttributeDescription
data-disabled

Present when the component should ignore user interaction.

data-touched

Present when the field has been touched.

data-dirty

Present when the field value has changed from its initial value.

data-filled

Present when the field has a value.

data-focused

Present when the field is focused.

SelectList

A container for the select items. Renders a <div> element.

Base UI Select.List docs

SelectPopup

A container for the select list. Renders a <div> element.

Base UI Select.Popup docs

Data attributes
AttributeDescription
data-open

Present when the select is open.

data-closed

Present when the select is closed.

data-starting-style

Present when the select begins animating in.

data-ending-style

Present when the select is animating out.

data-side

Values: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'

Indicates which side the popup is positioned relative to the trigger.

data-align

Values: 'start' | 'center' | 'end'

Indicates how the popup is aligned relative to specified side.

SelectPortal

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.

Base UI Select.Portal docs

SelectPositioner

Positions the select popup. Renders a <div> element.

Base UI Select.Positioner docs

Props
PropTypeDefaultDetails
align'center' | 'end' | 'start''start'
sideOffsetnumber | OffsetFunction4
alignItemWithTriggerbooleanfalse
Base UI Select.Positioner docs
Data attributes
AttributeDescription
data-open

Present when the select popup is open.

data-closed

Present when the select popup is closed.

data-anchor-hidden

Present when the anchor is hidden.

data-side

Values: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'

Indicates which side the popup is positioned relative to the trigger.

data-align

Values: 'start' | 'center' | 'end'

Indicates how the popup is aligned relative to specified side.

CSS variables
VariableDescription
--available-width

Values: number

The available width between the trigger and the edge of the viewport.

--available-height

Values: number

The available height between the trigger and the edge of the viewport.

--anchor-width

Values: number

The anchor's width.

--anchor-height

Values: number

The anchor's height.

--transform-origin

Values: string

The coordinates that this element is anchored to. Used for animations and transitions.

SelectSeparator

A visual separator between items or groups. Renders a <div> element.

Base UI Select.Separator docs

Data attributes
AttributeDescription
data-orientation

Values: 'horizontal' | 'vertical'

The orientation of the separator.

SelectTrigger

A button that opens the select popup. Renders a <button> element.

Base UI Select.Trigger docs

Props
PropTypeDefaultDetails
size'large' | 'medium' | 'small''medium'
Base UI Select.Trigger docs
Data attributes
AttributeDescription
data-popup-open

Present when the corresponding select is open.

data-pressed

Present when the trigger is pressed.

data-disabled

Present when the select is disabled.

data-readonly

Present when the select is readonly.

data-popup-side

Values: 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null

Indicates which side the corresponding popup is positioned relative to its anchor.

data-required

Present when the select is required.

data-valid

Present when the select is in a valid state (when wrapped in Field.Root).

data-invalid

Present when the select is in an invalid state (when wrapped in Field.Root).

data-touched

Present when the select has been touched (when wrapped in Field.Root).

data-dirty

Present when the select's value has changed (when wrapped in Field.Root).

data-filled

Present when the select has a value (when wrapped in Field.Root).

data-focused

Present when the select trigger is focused (when wrapped in Field.Root).

data-placeholder

Present when the select doesn't have a value.

SelectValue

A text label of the currently selected item. Renders a <span> element.

Base UI Select.Value docs

Props
PropTypeDefaultDetails
children((value: SelectSelectedValue<Value, Multiple>) => React.ReactNode) | React.ReactNodeNo default
Base UI Select.Value docs
Data attributes
AttributeDescription
data-placeholder

Present when the select doesn't have a value.