ui
Select
Displays a list of options for the user to pick from, triggered by a button.
1. Import
Import the select components from the design system.
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/design-system/components/ui/select"2. Props
Select component props.
| Prop | Type | Default |
|---|---|---|
| size | "sm" | "default" | "default" |
| value | string | -- |
| defaultValue | string | -- |
| onValueChange | (value: string) => void | -- |
| disabled | boolean | false |
| className | string | -- |
3. Usages
Common select patterns and configurations.
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/design-system/components/ui/select";
export function Example() {
return (
<Select>
<SelectTrigger className="w-64">
<SelectValue placeholder="Select a fruit" />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="orange">Orange</SelectItem>
<SelectItem value="grape">Grape</SelectItem>
</SelectContent>
</Select>
);
}