Default
The browser's own select in a hand-drawn frame: its popup, its mobile picker, its typeahead. The chevron is drawn; a first option with an empty value reads as a placeholder.
The browser's own <select> in a hand-drawn frame with a pencil chevron. You keep the platform's popup, mobile picker, typeahead and autofill, and a list of hundreds of options costs nothing. Reach for Select when you want the paper slip.
npx shadcn@latest add @wobko/native-selectFirst time here? Add the registry to components.json first. How to install
The browser's own select in a hand-drawn frame: its popup, its mobile picker, its typeahead. The chevron is drawn; a first option with an empty value reads as a placeholder.
Option groups, a small size, an invalid select (red pencil box and a bang before the chevron) and a disabled one (dashed, pale).
A real-world use: a native select next to inputs in a form. It submits and resets like any select, `required` stops an empty submit, and the second select follows the first.
shadcn's `native-select-demo`: the browser's own `<select>` with a first option whose value is empty, which reads as the placeholder. Its list, keyboard and phone picker are the platform's.
shadcn's `native-select-groups`: `NativeSelectOptGroup` is an `<optgroup>`, so the platform draws the group headings and indents the options under them.
shadcn's `native-select-disabled`: `disabled` on the select. The frame is drawn dashed and pale and the chevron fades with it.
shadcn's `native-select-invalid`: `aria-invalid="true"` redraws the frame in red pencil with a bang before the chevron. It is the same attribute a form library sets.
A `<span data-slot="native-select-wrapper">` (the drawn frame, the ink host) around the real `<select data-slot="native-select">` and a chevron. `ref` and every prop go to the select; `className` and `style` go to the frame, except padding and control-only variants (`focus:`, `disabled:` ...).
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "default" | "sm" | "default" | 36 px or 32 px tall (28 px in calm density). Not the HTML `size` attribute; use `multiple` for a list box. |
| aria-invalid | boolean | "true" | "false" | - | true draws the red pencil box, a wavy underline and a bang before the chevron. |
| disabled | boolean | - | Dashed pencil on a pale wash. |
| seed | string | number | - | Pins the hand: the same seed always draws the same box. Default: derived from useId(). |
The files the CLI copies into your project.
Loading the source