Docs
Select
Select
Select component to select value from options.
Usage
Example Code
1import {
2 Select,
3 SelectContent,
4 SelectItem,
5 SelectTrigger,
6 SelectValue,
7 } from "inc-design-system/select"
Example Code
1<Select>
2 <SelectTrigger className="w-[180px]">
3 <SelectValue placeholder="Theme" />
4 </SelectTrigger>
5 <SelectContent>
6 <SelectItem value="light">Light</SelectItem>
7 <SelectItem value="dark">Dark</SelectItem>
8 <SelectItem value="system">System</SelectItem>
9 </SelectContent>
10</Select>
Props
Select
Prop | Type | Description | Default |
---|---|---|---|
onValueChange | (value: string) => void | A callback function is invoked when the selected value changes. Receives the newly selected value as an argument. | - |
defaultValue | string | The default value of the select component. | - |
value | string | The value of the select component. | - |
disabled | boolean | Disables the select component. | - |
onOpenChange | (open: boolean) => void | Event handler called when the open state of the select changes. | - |
SelectValue
Prop | Type | Description | Default |
---|---|---|---|
placeholder | string | The placeholder of the select value. | - |