Skip to main content

Select

Dropdown for single or multi-value selection. Uses native <select> styled by @primus/ui-core.

Preview ยท Select

Codeโ€‹

<div class="vstack" style="max-width:320px">
<label>Plan
<select>
<option value="">Choose a plan...</option>
<option>Starter</option>
<option>Pro</option>
<option>Enterprise</option>
</select>
</label>
<div data-field="error">
<label>Region
<select aria-invalid="true"><option>Choose region...</option></select>
</label>
<span class="error">Please select a region.</span>
</div>
</div>

Propsโ€‹

PropTypeDefaultDescription
labelstringโ€”Label text
optionsSelectOption[][]Options {label,value,disabled?}
valuestringโ€”Selected value
multiplebooleanfalseMulti-select
errorstringโ€”Error message

Accessibilityโ€‹

  • Native <select> โ€” fully keyboard navigable with โ†‘โ†“ and Enter
  • Label association handled automatically via for/id pairing
  • Error state sets aria-invalid="true"
  • Disabled options use the native disabled attribute
Version history

See the Changelog for version history and breaking changes.