Esc
Documentation
On this page

Props

PropTypeDefaultDescription
name requiredstringNoneField name
labelstringNoneLabel text
options requiredreadonly SelectOption[]NoneAvailable options
valuestring | nullNoneCurrently selected value
onChange(value: string | null) => voidNoneChange callback (browser only)
placeholderstringNonePlaceholder 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;
}

View the source on GitHub