Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
- Typography
Get Started
@shadcn/react
@shadcn/helpers
Force UI registry
Utilities
Installation#
pnpm dlx shadcn@latest add @force-ui-svelte/native-select
Usage#
<script lang="ts">
import * as NativeSelect from "$lib/components/ui/native-select/index.js";
</script><NativeSelect.Root>
<NativeSelect.Option value="">Select a fruit</NativeSelect.Option>
<NativeSelect.Option value="apple">Apple</NativeSelect.Option>
<NativeSelect.Option value="banana">Banana</NativeSelect.Option>
<NativeSelect.Option value="blueberry">Blueberry</NativeSelect.Option>
<NativeSelect.Option value="pineapple">Pineapple</NativeSelect.Option>
</NativeSelect.Root>Composition#
Simple#
Options placed directly under NativeSelect.Root (no NativeSelect.OptGroup).
NativeSelect.Root
├── NativeSelect.Option
├── NativeSelect.Option
├── NativeSelect.Option
└── NativeSelect.OptionWith groups#
Use NativeSelect.OptGroup to organize options into categories.
NativeSelect.Root
├── NativeSelect.OptGroup
│ ├── NativeSelect.Option
│ └── NativeSelect.Option
└── NativeSelect.OptGroup
├── NativeSelect.Option
└── NativeSelect.OptionExamples#
Groups#
Use NativeSelect.OptGroup to organize options into categories.
Disabled#
Add the disabled prop to the NativeSelect.Root component to disable the select.
Invalid#
Use aria-invalid to show validation errors and the data-invalid attribute to the Field component for styling.
Native Select vs Select#
- Use
NativeSelectfor native browser behavior, better performance, or mobile-optimized dropdowns. - Use
Selectfor custom styling, animations, or complex interactions.
RTL#
To enable RTL support in Force UI, see the RTL configuration guide.
API Reference#
NativeSelect.Root#
The main select component that wraps the native HTML select element.
<NativeSelect.Root>
<NativeSelect.Option value="option1">Option 1</NativeSelect.Option>
<NativeSelect.Option value="option2">Option 2</NativeSelect.Option>
</NativeSelect.Root>NativeSelect.Option#
Represents an individual option within the select.
| Prop | Type | Default |
|---|---|---|
value | string | |
disabled | boolean | false |
NativeSelect.OptGroup#
Groups related options together for better organization.
| Prop | Type | Default |
|---|---|---|
label | string | |
disabled | boolean | false |
<NativeSelect.OptGroup label="Fruits">
<NativeSelect.Option value="apple">Apple</NativeSelect.Option>
<NativeSelect.Option value="banana">Banana</NativeSelect.Option>
</NativeSelect.OptGroup>Deploy your shadcn/ui app on Vercel
Trusted by OpenAI, Sonos, Adobe, and more.
Vercel provides tools and infrastructure to deploy apps and features at scale.
Deploy to Vercel