How to build an accessible NativeSelect in React

It is a real <select>, so the browser provides the combobox role, keyboard interaction, and announcement. aria-invalid is set when invalid; the placeholder is a disabled hidden first option so it shows but is not selectable.

When to use a NativeSelect

When not to use it

Keyboard interactions

Role combobox, verified at WCAG 2.2-AA.

Common mistakes

Avoid: <NativeSelect options={oneHundredOptionsWithIcons} />

Prefer: <Combobox options={...} />

Native <option> cannot render icons or be searched; use a custom listbox for rich options

Example

<NativeSelect
  placeholder="Choose a country"
  options={[
    { value: 'us', label: 'United States' },
    { value: 'de', label: 'Germany' },
  ]}
  onChange={(e) => setCountry(e.target.value)}
/>

See the full NativeSelect reference →