Select
Select provides a styled single-choice list when the product needs a consistent popup or richer option content. Use Combobox when users need to search or create values.
No fruit selected yet.
Usage
Include CSS
Import Tailwind and one full A3S UI style bundle.
Or import only the base CSS, Select component CSS, and one style pack.
Using CDN or bundler imports? See the Installation page.
Include JavaScript
Copy or serve the full A3S UI JavaScript bundle.
Or copy or serve the A3S UI runtime and Select script.
Using CDN or bundler imports? See the Installation page.
Add your select HTML
HTML structure
<div class="select">Select root. Add
data-placeholderto show placeholder text when no value is selected. Supportsdata-close-on-select="true"for multiple select anddata-format="object"for serialized object values.<button type="button">- Select-only combobox trigger. Give it a stable accessible name with a connected
<label>,aria-label, oraria-labelledby; placeholder text is a value hint, not a label. Userole="combobox",aria-haspopup="listbox",aria-autocomplete="none",aria-expanded, andaria-controls. The controller supplies stable option IDs foraria-activedescendant. <div data-popover aria-hidden="true">Popover content. Supports
data-sideanddata-alignthrough the shared Popover rules; the runtime flips and clamps the list to the visual viewport.<div role="listbox">Options container. Add
aria-multiselectable="true"for multiple selection.<div role="option" data-value="..." data-label="...">- Selectable option.
data-valueis submitted.data-labelis optional and controls the selected display label anddata-format="object"label; when omitted, A3S UI uses trimmed text content. <hr role="separator">Optional- Separator between groups or options.
<div role="group">Optional- Option group. Use
aria-labelledbyto connect it to its heading. <span role="heading">Optional- Group heading.
<input type="hidden">- Submitted value. Empty value means no selection when the root has
data-placeholder. Single select stores a string; multiple select stores a JSON array. Withdata-format="object", values are serialized as{ value, label }objects.
JavaScript API
Examples
Groups
Scrollable
A select with many items that scrolls.
Disabled control
Disabled option
Disabled options stay visible for context but are skipped by pointer, arrow-key, Home, End, and typeahead navigation.
Invalid
Please select a valid fruit.
RTL
Accessibility
Give every trigger a stable accessible name with a connected label, aria-label, or aria-labelledby; the placeholder and selected value do not replace the field label. Focus remains on the select-only combobox trigger while aria-activedescendant identifies the active option. Arrow keys move through enabled options, Home and End reach the first and last enabled option, printable text performs accent-insensitive typeahead, Enter or Space commits, and Escape closes without changing the value and restores trigger focus.
