Select

Displays a list of options for the user to pick from—triggered by a button.

Contains all the parts of a select. It inherits props from the Select primitive Root part.

PropTypeDefault
size"1" | "2" | "3""2"

The button that toggles the select. This component inherits props from the Select primitive Trigger and Value parts. It supports common margin props.

PropTypeDefault
placeholderstring
ghostboolean

The component that pops out when the select is open. It inherits props from the Select.Portal primitive and Select.Content primitive parts.

The component that contains the select items. It inherits props from the Select.Item primitive part.

Used to group multiple items. It inherits props from the Select.Group primitive part. Use in conjunction with Select.Label to ensure good accessibility via automatic labelling.

Used to render the label of a group, it isn’t focusable using arrow keys. It inherits props from the Select.Label primitive part.

Used to visually separate items in the Select. It inherits props from the Select.Separator primitive part.

Use the size prop to control the size.

Ghost

Use the ghost trigger variant to render the trigger without a visually containing element. Ghost triggers behave differently in layout as they use a negative margin to optically align themselves against their siblings while maintaining their padded active and hover states.

Use the placeholder prop to create a Trigger that doesn’t need an initial value.

Set position="popper" prop to position the select menu below the trigger.

When using server-side rendering, you might notice a layout shift after hydration. This is because Trigger executes client-side code to display the selected item’s text. To avoid that layout shift, you can render it manually by mapping values.

You can customise how Trigger renders the value by controlling its children manually. For example, you can render an icon next to the selected item’s text.