Select Box Component
A customizable select component for selecting a value from a list of options.
Basic Usage
A simple select box with options.
Select a fruit
Sizes
Select boxes in different sizes.
Small
Medium
Large
States
Select boxes in different states.
Disabled
Disabled select
Error
Error state
Theme Selector Example
A practical example of using the select component.
Select theme
API Reference
The props and options for the Select component.
Select
| Prop | Description | Type | Default |
|---|---|---|---|
| value | The controlled value of the select | string | - |
| defaultValue | The default value of the select | string | - |
| onChange | Callback when value changes | (value: string) => void | - |
| disabled | Whether the select is disabled | boolean | false |
SelectTrigger
| Prop | Description | Type | Default |
|---|---|---|---|
| size | The size of the trigger | "sm" | "md" | "lg" | "md" |
| error | Whether to show error styling | boolean | false |
SelectValue
| Prop | Description | Type | Default |
|---|---|---|---|
| placeholder | Placeholder text when no value is selected | string | "Select an option" |
SelectItem
| Prop | Description | Type | Default |
|---|---|---|---|
| value | The value of the item | string | Required |
| disabled | Whether the item is disabled | boolean | false |