Skip to content

Select

Stable

A styled native dropdown with a drawn chevron, a placeholder and an invalid state.

Also known as dropdown, dropdown list, picker, native select

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Options from data

Pass options. An option can be disabled. Pass an aria-label when there is no visible label.

When to use it

Picks one value from a list that is too long for side-by-side buttons, using the platform's own menu so it is reliable everywhere.

Made of: Box · Selected text · Chevron

Use it for

  • Choosing a model, language or time zone from a list.
  • Any single choice from more than about five options.
  • A form where the native picker on phones is an advantage.

Not for

  • Two to four options that should all stay visible: use SegmentedControl.
  • A menu with actions, icons or rich content: use Popover.
  • Free text the user types: use TextField.

Do and avoid

Do. A long list of choices tucked into one compact menu.
Avoid. Two choices hidden in a menu take an extra tap to see.

Do

  • Use it for a list the user chooses from once.
  • Put the most likely choice first, or set a value up front.
  • Wrap it in Field so it has a visible label.
  • Use children with optgroup to group long lists.

Avoid

  • Do not use it for two or three options. Use SegmentedControl.
  • Do not put actions in it, such as Delete. Use a menu.
  • Do not use placeholder as the label.
  • Do not try to style the open menu. It belongs to the browser.

On a phone

  • It is a native select, so a phone shows its own picker and the open list is not styled by this system.
  • It fills the width of its container, is 44px tall on touch screens, and its text is 16px so iPhones do not zoom.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started