Installation
npx logic2b@next add native-selectUsage
import { NativeSelect } from "@/components/ui/native-select"
<NativeSelect
aria-label="Favorite fruit"
defaultValue="apple"
className="w-[180px]"
>
<option value="apple">Apple</option>
<option value="banana">Banana</option>
</NativeSelect>
Native Select vs. Select
Use NativeSelect instead of Select when you
want the browser’s own picker rather than a custom listbox:
- Mobile — opens the OS-native wheel/sheet picker instead of a popover, which is what most users expect on touch devices.
- Long option lists — native scrolling and type-ahead, no virtualization needed.
- Forms without JS interactivity budget — it’s a real
<select>, so it works with native form submission and<form>validation out of the box.
Reach for Select instead when you need custom option content (icons,
descriptions, grouping headers) or a listbox that visually matches Radix’s
popover styling exactly.
Examples
Disabled
Accessibility
Renders a real <select> element, so it inherits the browser’s built-in
listbox semantics and keyboard support for free:
- Opens with Enter/Space/↓, closes with Esc or a selection.
- Type-ahead jumps to the first matching option.
- Assistive technology announces the control as a native select — no ARIA wiring needed.
- Pair with a
<label htmlFor>(or wrap in aField) for an accessible name.
Live playground
Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.
<NativeSelect
size="default"
defaultValue="team"
aria-label="Workspace plan"
>
<option value="starter">Starter</option>
<option value="team">Team</option>
<option value="enterprise">Enterprise</option>
</NativeSelect>API reference
Generated from the public TypeScript exports in src/ui/native-select.tsx.
NativeSelect
ComponentProps: React.ComponentProps<"select"> & VariantProps<typeof nativeSelectVariants>| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
size | undefined | No | — | — |
Accessibility contract
Machine-readable behavior and consumer responsibilities for native-select.
- Support
- Native semantics
- Pattern
- select
- HTMLSelectElement
| Keys | Behavior |
|---|---|
| ArrowUp ArrowDown ArrowLeft ArrowRight | Move within the composite control. |
| Alt+ArrowDown | Open the platform option picker where supported. |
Built-in semantics
- Uses native select/listbox semantics and forwards invalid/disabled state.
Consumer responsibilities
- Associate it with a label; do not rely on placeholder-like first options as the name.