Select
atomNative dropdown for choosing from a fixed list of options. Supports label, placeholder, error state, and three sizes.
Default
Select with label and placeholder.
Sizes
Three sizes — sm, md, and lg.
Error state
Red border and message for validation.
Usage
Installation
API Reference
Select props — * required
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Label above the select. |
placeholder | string | — | Default empty option shown when no value is selected. |
options* | Array<{ value: string; label: string }> | — | The list of selectable options. |
value | string | — | Controlled value. |
defaultValue | string | — | Uncontrolled initial selection. |
size | "sm" | "md" | "lg" | "md" | Height and font size. |
errorText | string | — | Error message; triggers the error visual state. |
disabled | boolean | false | Prevents interaction. |
onChange | (e: React.ChangeEvent<HTMLSelectElement>) => void | — | Change handler. |