Skip to Content

Select

The Select component renders a Windows 98 styled custom select with a trigger button and an option list. SelectNative provides a native select alternative.

Props

PropTypeDefaultDescription
namestring-Name used for form submission.
optionsSelectOption[]-Options with value and optional label.
valueT-Controlled selected value.
defaultValueT-Initial selected value for uncontrolled usage.
onValueChange(value, option) => void-Selection value change callback.
labelstring-Optional visible label.
disabledbooleanfalseDisables the select.
menuMaxHeightnumber | string-Maximum height of the custom option list.
widthCSSProperties['width']-Width of the select control.

Examples

Custom select

Native select

Scrollable options

Viewport edge detection

ARIA

The custom select uses combobox and listbox roles. The selected option exposes aria-selected, and disabled state is communicated through aria-disabled.

Keyboard

KeyBehavior
Enter / Space / ArrowDownOpens the custom select.
ArrowUp / ArrowDownMoves through options while open.
Home / EndJumps to the first or last option.
Printable charactersMoves focus to the next option whose label starts with the typed buffer.
EscapeCloses without selecting.
TabCloses and moves focus onward.

SSR

Select is a client component through the package root. Initial selected values should be stable between server and client to avoid hydration drift.

Last updated on