Faber UI
Components

NativeSelect

A styled native HTML select.

NativeSelect is a styled wrapper around the native HTML select element, preserving platform-specific behavior and accessibility.

Installation

Terminal
pnpm dlx shadcn@latest add https://faber-ui.vercel.app/r/native-select.json

Usage

typescript
import {
  NativeSelect,
  NativeSelectOption,
} from "@/components/ui/native-select";

export default function Example() {
  return (
    <NativeSelect>
      <NativeSelectOption value="apple">Apple</NativeSelectOption>
      <NativeSelectOption value="banana">Banana</NativeSelectOption>
    </NativeSelect>
  );
}

Examples

Default

Small

API

Each part forwards every prop of what it is built on, including className and render where Base UI supports it. The props column lists only what Faber UI adds on top.

PartBuilt onProps
NativeSelectdata-slot="native-select"<select>HTML
  • size? = "default""sm" | "default"
NativeSelectOptiondata-slot="native-select-option"<option>HTML—
NativeSelectOptGroupdata-slot="native-select-optgroup"<optgroup>HTML—

Changelog

  1. v0.3.0Input, Textarea, NativeSelect, CommandInput and ComboboxChipsInput use 16px text on small screens so iOS Safari no longer zooms the page on focus.patch
Full NativeSelect history

Last updated on

On this page