Files
shadcn-ui/apps/www/content/docs/components/select.mdx
2023-06-22 22:44:52 +04:00

57 lines
946 B
Plaintext

---
title: Select
description: Displays a list of options for the user to pick from—triggered by a button.
component: true
featured: true
radix:
link: https://www.radix-ui.com/docs/primitives/components/select
api: https://www.radix-ui.com/docs/primitives/components/select#api-reference
---
<ComponentPreview name="select-demo" />
## Installation
<Steps>
### Command
```bash
npx shadcn-ui add select
```
### Usage
```tsx
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
```
```tsx
<Select>
<SelectTrigger className="w-[180px]">
<SelectValue placeholder="Theme" />
</SelectTrigger>
<SelectContent>
<SelectItem value="light">Light</SelectItem>
<SelectItem value="dark">Dark</SelectItem>
<SelectItem value="system">System</SelectItem>
</SelectContent>
</Select>
```
</Steps>
---
## Examples
### Form
<ComponentPreview name="select-form" />