Select

Custom listbox control with labels, validation, and keyboard support.

Add it to your project

Eject the complete select group, then import from its generated local barrel. The copied source and CSS belong to your application.

bash
pnpm exec toucan eject select
app.tsx
import { Select } from '@/components/toucan/select';

Use when

Users choose one value from a compact list that should not remain fully visible.

Avoid when

There are only a few important choices; Radio is easier to scan.

Example

Country

API reference

Generated from packages/react/src/components. Only Toucan-specific props are listed; forwarded native props remain available as noted for each export.

Select

Select

Props type: SelectProps

NameTypeDefaultRequiredDescription
defaultValuestringundefinedNoInitial value when the component is uncontrolled.
descriptionstringundefinedNoSupporting text connected to the control.
disabledbooleanundefinedNoPrevents interaction when true.
errorstringundefinedNoValidation error text or error state.
hideLabelbooleanundefinedNoVisually hide the label while keeping it available to assistive technology.
labelstringundefinedNoVisible or accessible label for the control.
onChange(value: string) => voidundefinedNoCalled when the value changes.
optionsSelectOption[]—RequiredAvailable select options and their values.
placeholderstring'Select an option'NoText shown before a select option has been chosen.
renderOption(option: SelectOption) => React.ReactNodeundefinedNoCustom render function for option content. Receives the option and returns a ReactNode.
requiredbooleanundefinedNoMarks the control as required.
size"sm" | "md" | "lg"undefinedNoVisual size variant.
valuestringundefinedNoControlled value.

Also accepts the native div attributes that are not replaced by a Toucan prop.

Type exports

SelectOption, SelectProps

ts
export type SelectOption = { value: string; label: string; disabled?: boolean };

Accessibility

  • Implements combobox and listbox semantics.
  • Supports keyboard navigation, typeahead, dismissal, and focus return.

Token families

selectfocus

Related components