Skip to main content

Select

Dropdown select form control styled classless via the native <select> element. Uses a CSS background-image chevron, preserves native semantics and keyboard behavior, and supports option groups, multiple selection, disabled, and validation states.

Usage​

When to use

  • Choosing a single option from a short-to-medium list of mutually exclusive values
  • Grouping related options via <optgroup>
  • Allowing multiple selection with <select multiple>

When not to use

  • Fewer than three options - use radio buttons
  • Options with rich content (icons, descriptions) - use a custom combobox component
  • Free-text entry - use an input with datalist instead

Do

  • Associate a <label> with the select via for/id
  • Use <optgroup label="..."> for grouping related options
  • Set aria-invalid="true" for validation errors

Don't

  • Build a custom dropdown - Semetrika ships only the native control
  • Omit the label or rely on placeholder text alone

API​

Slots​

SlotRequiredDescription
labelYesVisible label text for the select.

Props​

PropTypeDefaultDescription
optionsarray-Array of option or optgroup objects. Options have text, value, is_selected, is_disabled fields. Optgroups have type "optgroup", label, and a nested options array.
namestring-Name attribute for the select element.
idstring-Associates the control with its label. Auto-generated when omitted.
is_multipleboolean-Allows multiple simultaneous selection.
rowsnumber-Number of visible rows for multi-select (maps to the size HTML attribute).
is_disabledboolean-Disables the control.
is_requiredboolean-Marks the control as required.
is_invalidboolean-Marks the control as invalid. Renders aria-invalid="true" when set.
classesarray-Additional CSS class words merged into the root element.
attributesobject-Additional HTML attributes spread on the root element.

Classes​

ClassCapabilityDefaultDescription
.smSize-Small.
.mdSizeYesMedium.
.lgSize-Large.

Examples​

Sizes​

Sm, default, and lg variants stacked vertically. Font size, padding, and chevron all scale together.

Default​

Single-selection select with placeholder and a handful of options.

Grouped​

Select with <optgroup> grouping related options.

Multiple​

<select multiple> allowing multiple value selection.

Invalid​

Validation error state via aria-invalid="true".

Disabled​

Disabled select via the disabled attribute.

Multiple grouped​

The two previous variants combined, a multi-select whose options are divided into <optgroup> sections.

Accessibility​

  • WCAG 2.2 AA
  • Native <select> semantics preserved (no custom dropdown)
  • <optgroup> uses label attribute for screen readers
  • aria-invalid reflects validation state
  • Visible focus ring via :focus-visible
  • Keyboard support comes from the native control (Up/Down, Home, End, typeahead, Space/Enter to open)

Dependencies​

  • textfield - shared visual tokens (background, border, focus, placeholder)