Components
- Accordion
- Alert Dialog
- Alert
- Autocomplete
- Avatar
- Badge
- Button Group
- Button
- Card
- Carousel
- Chart
- Checkbox
- Clipboard
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Editable
- Field
- File Upload
- Floating Panel
- Hover Card
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- QR Code
- Radio Group
- Rating Group
- Scroll Area
- Select
- Separator
- Sheet
- Skeleton
- Slider
- Spinner
- Splitter
- Steps
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle Group
- Toggle
- Tooltip
- Tour
- Tree View
For a styled select component, use the Select component.
Installation
pnpm dlx shadcn@latest add @shark-ui/native-select
Usage
import { NativeSelect, NativeSelectOptGroup, NativeSelectOption, } from "@/components/ui/native-select";
<NativeSelect> <NativeSelectOptGroup label="Group 1"> <NativeSelectOption value="1">Option 1</NativeSelectOption> <NativeSelectOption value="2">Option 2</NativeSelectOption> <NativeSelectOption value="3">Option 3</NativeSelectOption> </NativeSelectOptGroup> </NativeSelect>
Sizes
Use the size prop to change the select height.
Small
Medium
Large
Examples
Default
Groups
Use <NativeSelectOptGroup /> to group options with a label.
Disabled
Use the disabled prop to disable the select.
Invalid
Use the aria-invalid to <Select /> or invalid prop on the <Field /> to mark the select as invalid and show error styling.
Native Select vs Select
- NativeSelect — Use for native browser behavior, better performance, or mobile-optimized dropdowns.
- Select — Use for custom styling, animations, or complex interactions.
API Reference
NativeSelect
Extends native <select> props. Additional props:
| Prop | Type | Default |
|---|---|---|
size | sm, md, lg | md |
disabled | boolean | — |
aria-invalid | boolean | — |
NativeSelectOptGroup
Extends native <optgroup> props. Use label for the group label.
NativeSelectOption
Extends native <option> props. Use value and children for option value and label.