Skip to Content
⭐️ Leave a star →
ComponentsSelect

Select

Accessible select menu with groups, separators, and a fully custom trigger element.

Features

Accessible select with full keyboard navigation.
Supports groups, separators, and custom trigger.
Can be controlled or uncontrolled.
Supports disabled state per item or globally.

Example

import { Select } from '@wire-ui/react' <Select.Root value={value} onChange={setValue}> <Select.Trigger> <Select.Value placeholder="Select a framework" /> </Select.Trigger> <Select.Content> {['React', 'Vue', 'Angular', 'Svelte', 'Solid'].map((fw) => ( <Select.Item key={fw} value={fw.toLowerCase()}> {fw} </Select.Item> ))} </Select.Content> </Select.Root>

Styling

Select uses data-state on the Trigger to indicate open/closed, and data-selected, data-hover, data-disabled on items.

<Select.Trigger className=" border border-black data-[state=open]:ring-2 data-[state=open]:ring-black data-[hover]:bg-gray-50 data-[disabled]:opacity-50 " /> <Select.Item className=" data-[hover]:bg-gray-100 data-[selected]:font-medium data-[disabled]:opacity-40 " />

Using data attributes

Trigger receives data-state ("open" / "closed"). Items receive data-selected, data-hover, and data-disabled.

/* Open trigger */ [data-state="open"] { box-shadow: 0 0 0 2px #6366f1; } /* Selected item */ [data-selected] { font-weight: 600; } /* Hovered item */ [data-hover] { background: #f5f5f5; }

Root props

PropTypeDefaultDescription
valuestringControlled selected value
defaultValuestringInitial value for uncontrolled use
onValueChange(value: string) => voidCalled when selection changes
disabledbooleanfalseDisables the select

Item props

PropTypeDescription
valuestringThe value this item represents
disabledbooleanDisables this specific item

Item data attributes

AttributeWhen present
data-selectedThis item is currently selected
data-disabledItem is disabled

Keyboard Interactions

KeyDescription
SpaceOpens the select menu when trigger is focused. Selects the focused item when menu is open.
EnterOpens the select menu when trigger is focused. Selects the focused item when menu is open.
ArrowDownOpens the menu or moves focus to the next item.
ArrowUpMoves focus to the previous item.
EscapeCloses the menu and returns focus to the trigger.
Last updated on

MIT License © 2026 wire-ui

Select – Wire UI