Skip to content

Inputs

Select

A native select dressed to match the other fields: same heights, border, focus ring and invalid state, with a chevron and an optional leading icon. It keeps the platform picker, which is the best option list on phones. For long, searchable lists use Combobox.

On this page

Where your data is stored.

Usage

components/ui/select.tsx
import { Field } from "@/components/ui/field";import { Select } from "@/components/ui/select"; export function Example() {  return (    <Field label="Currency">      <Select defaultValue="eur">        <option value="eur">Euro (EUR)</option>        <option value="usd">US dollar (USD)</option>      </Select>    </Field>  );}

Examples

Overview

Where your data is stored.

Placeholder and groups

placeholder adds a greyed, unselectable first option. Native optgroup works as usual.

Sizes

States

Pick the country on your tax ID.

Managed by your organisation.

Props

  • size"sm" | "md" | "lg"default: "md"Height 32 / 36 / 40px.
  • placeholderstringdefault: —Greyed first option with value "", selected until the user picks.
  • iconReactNodedefault: —Icon before the value.
  • invalidbooleandefault: —Red border and aria-invalid. Set automatically by <Field error>.
  • classNamestringdefault: —Classes for the outer box.
  • ...propsSelectHTMLAttributesdefault: —Native attributes: value, defaultValue, onChange, name, required…

Accessibility

  • A real <select>: arrow keys, type-ahead and the native picker on iOS and Android all work out of the box.
  • Inside Field the label, hint and error are linked automatically; outside a Field, pass aria-label.
  • The placeholder option is disabled, so it can't be chosen again once a value is picked; combine with required to block empty submits.
  • The chevron and icon are decorative (aria-hidden) and don't intercept clicks.

Suggested