Select
One choice from a longer list. On React Native it opens as a sheet from the bottom.
import { Select } from '@rajatweb/argent'
<Select label="Plan" options={plans} onValueChange={setPlan} />Props
| Prop | Type | Default | What it does |
|---|---|---|---|
label required | string | ||
options required | readonly Option[] | ||
className | string | ||
defaultValue | string | ||
disabled | boolean | ||
error | string | Error text. Also marks the field invalid. | |
hint | string | Help text under the field. | |
id | string | ||
name | string | Form field name. | |
onValueChange | (value: string) => void | ||
placeholder | string | ||
required | boolean | ||
size | 'sm' | 'md' | 'lg' | 'md' | |
value | string |
Accessibility
- Works with arrow keys and type-ahead on the web.
Do
- Order options by how often they are picked.
Don’t
- Use it for two options.