Select

A common form component for choosing a predefined value in a dropdown menu.

API reference

Import the component and place its parts the following way:

Anatomy
import { Select } from '@base-ui-components/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.Item>
          <Select.ItemText />
          <Select.ItemIndicator />
        </Select.Item>
        <Select.Separator />
        <Select.Group>
          <Select.GroupLabel />
        </Select.Group>
      </Select.Popup>
      <Select.ScrollDownArrow />
    </Select.Positioner>
  </Select.Portal>
</Select.Root>

Root

Groups all parts of the select. Doesn’t render its own HTML element.

PropTypeDefault
alignItemToTriggerbooleantrue
defaultOpenbooleanfalse
defaultValueanynull
disabledbooleanfalse
namestringundefined
onOpenChangefunctionundefined
onValueChangefunctionundefined
openbooleanundefined
readOnlybooleanfalse
requiredbooleanfalse
valueanyundefined

Trigger

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

PropTypeDefault
classNamestring | (state) => stringundefined
disabledbooleanfalse
labelstringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Value

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

PropTypeDefault
classNamestring | (state) => stringundefined
placeholderstringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Icon

An icon that indicates that the trigger button opens a select menu. Renders a <span> element.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Backdrop

An overlay displayed beneath the menu popup. Renders a <div> element.

PropTypeDefault
classNamestring | (state) => stringundefined
keepMountedbooleanfalse
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Portal

A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to the <body>.

PropTypeDefault
containerReact.Ref | HTMLElement | nullundefined

Positioner

Positions the select menu popup against the trigger. Renders a <div> element.

PropTypeDefault
align'start' | 'center' | 'end''start'
alignOffsetnumber0
anchor| React.Ref
| Element
| VirtualElement
| (() => Element
| VirtualElement
| null)
| null
undefined
arrowPaddingnumber5
classNamestring | (state) => stringundefined
collisionBoundary| 'clippingAncestors'
| Element
| Element[]
| Rect
'clipping-ancestors'
collisionPaddingnumber | Rect5
positionMethod'absolute' | 'fixed''absolute'
render| React.ReactElement
| (props, state) => React.ReactElement
undefined
side| 'bottom'
| 'inline-end'
| 'inline-start'
| 'left'
| 'right'
| 'top'
'bottom'
sideOffsetnumber0
stickybooleanfalse
trackAnchorbooleantrue
CSS VariableType
--anchor-heightnumber
--anchor-widthnumber
--available-heightnumber
--available-widthnumber
--transform-originstring

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

PropTypeDefault
classNamestring | (state) => stringundefined
idstringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Arrow

Displays an element positioned against the select menu anchor. Renders a <div> element.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Item

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

PropTypeDefault
disabledbooleanfalse
labelstringundefined
valueanynull

Item Text

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

PropTypeDefault

Item Indicator

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

PropTypeDefault
classNamestring | (state) => stringundefined
keepMountedbooleanfalse
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Group

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

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Group Label

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

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Scroll Up Arrow

An element that scrolls the select menu down when hovered. Renders a <div> element.

PropTypeDefault
keepMountedbooleanfalse

Scroll Down Arrow

An element that scrolls the select menu down when hovered. Renders a <div> element.

PropTypeDefault
keepMountedbooleanfalse

Separator

A separator element accessible to screen readers. Renders a <div> element.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined