Skip to content
  • System
  • Light
  • Dark
  • High contrast

Select

import { Select } from '@eekodigital/raster';

<Select
name="standard"
placeholder="Choose a standard…"
options={[
  { value: 'wcag-2.2', label: 'WCAG 2.2' },
  { value: 'wcag-3.0', label: 'WCAG 3.0 (beta)' },
]}
/>
<Select name="standard" hasError placeholder="Choose a standard…" options={[...]} />
<Select name="standard" defaultValue="wcag-2.2" disabled options={[...]} />
import { SelectField } from '@eekodigital/raster';

<SelectField
label="Standard"
name="standard"
placeholder="Choose a standard…"
options={[
  { value: 'wcag-2.2', label: 'WCAG 2.2' },
  { value: 'wcag-3.0', label: 'WCAG 3.0 (beta)' },
]}
/>
<SelectField label="Standard" name="standard" hint="The standard all results will be evaluated against." options={[...]} />
<SelectField label="Standard" name="standard" error="Please select a standard." options={[...]} />
PropTypeDescription
optionsSelectOption[]

Array of { value, label, icon?, disabled? } objects.

placeholderstringText shown when no value is selected.
valuestringControlled selected value.
defaultValuestringInitial value for uncontrolled usage.
onValueChange(value: string) => voidCalled when the selected value changes.
hasErrorbooleanApplies error styling to the trigger.
disabledbooleanDisables the control.
namestringForm field name.
idstringID for label association.
PropTypeDescription
labelstringVisible label text.
optionsSelectOption[]

Array of { value, label, icon?, disabled? } objects.

placeholderstringPlaceholder shown when no value is selected.
hintstringOptional hint text below the label.
errorstringValidation error message.
valuestringControlled selected value.
defaultValuestringInitial value for uncontrolled usage.
onValueChange(value: string) => voidCalled when the selected value changes.