Select
Select Component
Playground
Props
| Prop | Type | Default | Value |
|---|---|---|---|
placeholder | string | β | |
label | string | β | |
error | string | β | |
helperText | string | β | |
size | 'sm' | 'md' | 'lg' | β | |
variant | 'default' | 'outlined' | β | |
disabled | boolean | β | |
searchable | boolean | β | |
multiple | boolean | β | |
options | SelectOption[] | β | β |
value | string | string[] | β | |
onValueChange | (value: string | string[]) => void | β | β |
Related Components
SelectItem
Usage
// Basic usage with children
<Select label="Choose an option" placeholder="Select...">
<SelectItem value="1">Option 1</SelectItem>
<SelectItem value="2">Option 2</SelectItem>
</Select>
// Searchable select
<Select
label="Search fruits"
searchable
options={[
{ value: 'apple', label: 'Apple' },
{ value: 'banana', label: 'Banana' },
]}
/>
// Multiple selection
<Select
label="Select multiple"
multiple
options={[
{ value: 'a', label: 'Option A' },
{ value: 'b', label: 'Option B' },
]}
value={['a']}
onValueChange={(values) => console.log(values)}
/>Variants
Style Variants
default
outlined
Disabled State
default disabled
outlined disabled
Sizes
sm
md
lg