Star5

Select

zyra-select

Custom dropdown select for choosing from a list of options — fully keyboard accessible with smooth open/close animation.

API

All inputs and configuration options for zyra-select.

PropTypeDefaultDescription
placeholderstring'Select an option'Text shown when no value is selected
size'sm' | 'md' | 'lg''md'Height and font scale
appearance'outline' | 'filled' | 'underline''outline'Visual style of the trigger
value (on option)string | number | null-The value emitted when the option is selected
disabled (on option)booleanfalsePrevents an option from being selected

Tokens

CSS custom properties zyra-select reads at runtime — override any of these in your own stylesheet after @use 'zyra-ng-ui'; to restyle it without touching the component itself.

TokenDefault points toDescription
Text
--zyra-color-select-text
var(--zyra-color-foreground)Color of the selected value / chip text in the trigger.
Placeholder
--zyra-color-select-placeholder
var(--zyra-color-foreground-subtle)Color of the placeholder text when nothing is selected.
Icon
--zyra-color-select-icon
var(--zyra-color-foreground-subtle)Color of the chevron/caret icon.
Background
--zyra-color-select-bg
var(--zyra-color-input-bg)Fill color of the trigger in the outline/filled appearances.
Border
--zyra-color-select-border
var(--zyra-color-input-border)Border color of the trigger in its resting state.
Filled background
--zyra-color-select-filled-bg
var(--zyra-color-surface-inset)Fill color specific to the filled appearance.
Focus border
--zyra-color-select-focus-border
var(--zyra-color-primary)Border/underline color of the trigger when focused or open.
Panel background
--zyra-color-select-panel-bg
var(--zyra-color-surface-dropdown)Fill color of the options panel.
Panel border
--zyra-color-select-panel-border
var(--zyra-color-border-color)Border color of the options panel.

Accessibility

Built to meet WCAG 2.0 AA. These notes cover the key ARIA, keyboard, and interaction behaviours.

  • Trigger uses aria-haspopup="listbox" and aria-expanded to communicate state
  • Panel uses role="listbox"; options use role="option" with aria-selected
  • aria-activedescendant on the trigger tracks the keyboard-highlighted option
  • Arrow keys navigate options; Enter/Space selects; Escape closes; Tab dismisses
  • Disabled options are marked aria-disabled and skipped by keyboard navigation