Select
A dropdown select island with optional search and clear support. Pass data as an array of strings or { value, label } objects. Use searchable to filter options by typed text.
Default
Pick a framework
React
Svelte
Vue
Angular
Solid
import { Select } from '@davaux/ui'
<Select
label="Framework"
placeholder="Pick a framework"
data={['React', 'Svelte', 'Vue', 'Angular', 'Solid']}
/>Custom option objects
Select country
United States
United Kingdom
Canada
Australia
Germany
<Select
label="Country"
placeholder="Select country"
data={[
{ value: 'us', label: 'United States' },
{ value: 'uk', label: 'United Kingdom' },
{ value: 'ca', label: 'Canada' },
]}
/>Searchable
Type to search...
United States
United Kingdom
Canada
Australia
Germany
France
Japan
<Select
label="Country"
placeholder="Type to search..."
searchable
data={[...]}
/>Clearable & initial value
TypeScript
TypeScript
JavaScript
Rust
Go
Python
<Select
label="Language"
data={['TypeScript', 'JavaScript', 'Rust', 'Go', 'Python']}
value="TypeScript"
clearable
/>Description & error
Select an option to continue
Pick one
Option A
Option B
Option C
Please make a selection
<Select
label="Required field"
description="Select an option to continue"
error="Please make a selection"
withAsterisk
placeholder="Pick one"
data={['Option A', 'Option B', 'Option C']}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
data | (string | { value, label, disabled? } )[] | [] | Option list |
value | string | '' | Initial selected value |
placeholder | string | 'Select an option' | Shown when nothing is selected |
label | string | — | Field label rendered above the select |
description | string | — | Helper text below the label |
error | string | — | Error message |
searchable | boolean | — | Filters options by typed text |
clearable | boolean | — | Shows a clear button when a value is selected |
disabled | boolean | — | Prevents interaction |
required | boolean | — | Marks the field required |
withAsterisk | boolean | — | Shows asterisk without native required |
nothingFound | string | 'Nothing found' | Text shown when search returns no results |
name | string | — | Form field name |
id | string | — | Associates label with input |