Skip to main content

Select

Dropdown select for choosing from a list of options. Built on Radix UI Select.

Import

import { Select } from '@kikumi3n/ui';

Usage

<Select
label="Country"
placeholder="Select a country"
options={[
{ value: 'vn', label: 'Vietnam' },
{ value: 'us', label: 'United States' },
{ value: 'jp', label: 'Japan' },
]}
/>

Controlled

const [country, setCountry] = useState('');

<Select
label="Country"
value={country}
onChange={setCountry}
options={[...]}
/>

API

PropTypeDefaultDescription
labelstringLabel text
placeholderstringPlaceholder text
optionsSelectOption[]requiredOptions list
valuestringControlled value
onChange(value: string) => voidChange handler
errorstringError message
disabledbooleanfalseDisable select

SelectOption

PropTypeDescription
valuestringOption value
labelstringDisplay label
disabledbooleanDisable option

Accessibility

Built on Radix UI Select:

  • Full keyboard navigation (Arrow keys, Enter, Escape)
  • Typeahead search
  • Proper ARIA attributes