Select
Dropdown input.
On this page
Props
| Prop | Type | Default | Description |
|---|---|---|---|
name required | string | None | Field name |
label | string | None | Label text |
options required | readonly SelectOption[] | None | Available options |
value | string | null | None | Currently selected value |
onChange | (value: string | null) => void | None | Change callback (browser only) |
placeholder | string | None | Placeholder text |
Example
ts
Select({
name: "warehouse",
label: "Warehouse",
options: [
{ label: "Small", value: "SMALL" },
{ label: "Medium", value: "MEDIUM" },
{ label: "Large", value: "LARGE" },
],
value: "MEDIUM",
})Supporting types
SelectOption
export interface SelectOption {
label: string;
value: string;
}