Skip to content

Native select

A styled native <select> with a Keyline chevron.

The browser's own menu: reach for it on phones and in dense forms. Use @khaeli/select when the list needs groups with separators, or to open in the system's style.

With a label

Sizes

With groups

Disabled

Invalid

Installation

npx shadcn@latest add @khaeli/native-select

Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.

Installs with

Registry items
npm packages
  • @keyline-icons/react ^2.2.0

Keyboard

Tab
Moves focus to the select. A disabled select leaves the tab order.
A to Z
Picks the next option that starts with the letter, without opening the menu.
SpaceArrowDownArrowUp
Open the menu or step through the options: the menu and its keys are the operating system's, not the item's.

Accessible name

  • The id goes to the <select>, so a @khaeli/label with htmlFor names it. Without a visible label, use aria-label.
  • className goes to the wrapper that holds the chevron; every other prop goes to the <select>.
  • An invalid control carries aria-invalid and lists the id of its message in aria-describedby, so the message is read as its description. @khaeli/field lays the label, control and message out.

Registry JSON

The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/native-select.json