Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Native Select

A styled wrapper around the native <select> element — platform-native option list and behavior with a token-matched look.

Installation

npx logic2b@next add native-select

Usage

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 a Field) 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.

Generated JSX
<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.

View JSON

NativeSelect

Component
Props: React.ComponentProps<"select"> & VariantProps<typeof nativeSelectVariants>
PropTypeRequiredDefaultDescription
sizeundefinedNo——

Accessibility contract

Machine-readable behavior and consumer responsibilities for native-select.

View JSON
Support
Native semantics
Pattern
select
HTMLSelectElement
Keyboard interactions for native-select
KeysBehavior
ArrowUp ArrowDown ArrowLeft ArrowRightMove within the composite control.
Alt+ArrowDownOpen 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.