Skip to content

shadcn.io is not affiliated with official shadcn/ui

Shadcn Native Select for React

Styled native HTML select element.

Installation

bunx --bun shadcn@latest add https://kit.dev/r/base/native-select.json

Usage

import {
  NativeSelect,
  NativeSelectOption,
} from "@/components/ui/native-select";
<NativeSelect>
  <NativeSelectOption value="">Select status</NativeSelectOption>
  <NativeSelectOption value="todo">Todo</NativeSelectOption>
  <NativeSelectOption value="in-progress">In Progress</NativeSelectOption>
  <NativeSelectOption value="done">Done</NativeSelectOption>
  <NativeSelectOption value="cancelled">Cancelled</NativeSelectOption>
</NativeSelect>

Demos

Groups

Options organized into labeled optgroups.

Disabled

Disabled native select.

Invalid

Invalid state via aria-invalid.

Rtl

Right-to-left native select. See the RTL configuration guide for document direction.

API Reference

NativeSelect

PropType
AttributeType
data-size?string

NativeSelectOption

PropType
AttributeType

NativeSelectOptGroup

PropType
AttributeType