Skip to main content
For a styled select component, see the Select component.

Installation

Usage

showLineNumbers
showLineNumbers

Examples

With Groups

Organize options using NativeSelect.OptGroup for better categorization.
showLineNumbers

Disabled State

Disable individual options or the entire select component.

Invalid State

Show validation errors with the aria-invalid attribute and error styling.
showLineNumbers

Native Select vs Select

  • Use NativeSelect when you need native browser behavior, better performance, or mobile-optimized dropdowns.
  • Use Select when you need custom styling, animations, or complex interactions.
The NativeSelect component provides native HTML select functionality with consistent styling that matches your design system.

Accessibility

  • The component maintains all native HTML select accessibility features.
  • Screen readers can navigate through options using arrow keys.
  • The chevron icon is marked as aria-hidden="true" to avoid duplication.
  • Use aria-label or aria-labelledby for additional context when needed.
showLineNumbers

API Reference

NativeSelect.Root

The main select component that wraps the native HTML select element. All other props are passed through to the underlying <select> element.

NativeSelect.Option

Represents an individual option within the select. All other props are passed through to the underlying <option> element.

NativeSelect.OptGroup

Groups related options together for better organization. All other props are passed through to the underlying <optgroup> element.