Select
One value from a short list. A listbox with typeahead and arrow-key navigation, and no search: once the list runs past a screenful or comes from a server, it is a Combobox.
Reach for it
One value from a set short enough to read, with no search.
Not for
A long list, an async list, or several values. That is a Combobox.
A handful of values
An option can be disabled and still shown, which is how a reader learns the value exists but is not available to them. The placeholder is required, because what to say before anything is chosen is copy.
A value that can be taken back
A clear button appears once something is chosen. `clearLabel` names it, and its presence is what adds it. A filter needs one, because clearing is how a reader removes the filter.
API reference
Select
| Prop | Type | Default | Description |
|---|---|---|---|
| options* | SelectOption[] | - | |
| placeholder* | string | - | Shown when nothing is selected. Copy is always passed in. |
| emptyLabel* | string | - | Shown in place of the list when there are no options. Required, like Combobox's. An open menu with nothing in it reads as a broken control rather than an empty one, and the package ships no copy of its own to say which it is. |
| data-testid | string | - | Names the element for a test. Never rendered, never announced. |
| size | 'small' | 'medium' | 'large' | medium | |
| hasStartAdornment | boolean | false | Room for a marker or a button inside the control's own padding box. The padding belongs to the control, so it lives here. The marker's own geometry belongs to the marker, so it lives in adornment.ts. Four components each carried the whole table before, and the one in combobox.tsx said "mirroring SearchInput" in a comment, which is the note a copy leaves behind. |
| hasEndAdornment | 'true' | 'false' | 'double' | false | `double` is two markers at the end, a clear button beside a calendar button. Twice the room, so the value never runs under either of them. |
| value | string | null | - | |
| defaultValue | string | - | |
| onValueChange | (value: string | null) => void | - | |
| isDisabled | boolean | - | |
| name | string | - | |
| clearLabel | string | - | Names the clear button, and its presence is what adds one. The same prop as Combobox's, for the same reason: a boolean plus a label would be two props describing one decision, and the button cannot exist without a name anyway. Base UI ships a `Clear` part for Combobox and none for Select, so this one is a button of our own beside the trigger rather than inside it. A button nested in the trigger's `<button>` is invalid markup and its click would open the list instead of clearing. |
| ariaLabel | string | - | Names the control when it is used outside a Field. `ariaLabel` rather than `label`, which is what this was: Checkbox and Switch take a `label` that is text the user reads, and one name for two opposite things in the same folder is how a caller ends up with an invisible label they meant to be visible. |