ARIA Listbox
The ARIA Listbox provides an accessible, selectable list component following WAI-ARIA patterns.Installation
Components
Listbox
Container for displaying a list of selectable items. Selector:[ngListbox]
Source: /home/daytona/workspace/source/src/aria/listbox/listbox.ts:53
Inputs
value(model) - The selected value(s). Use two-way binding with[(value)]multi(boolean) - Whether multiple selection is enabled. Default:falseorientation(‘vertical’ | ‘horizontal’) - List orientation. Default:'vertical'disabled(boolean) - Whether the listbox is disabled. Default:falsereadonly(boolean) - Whether the listbox is read-only. Default:falsewrap(boolean) - Whether keyboard navigation wraps around. Default:trueid(string) - Unique identifier for the listbox
Option
An individual selectable item within a listbox. Selector:[ngOption]
Inputs
value(required) - The value associated with this optionlabel(string) - The text label for the optiondisabled(boolean) - Whether this option is disabled
Basic Usage
Multiple Selection
Horizontal Orientation
With Disabled Options
Inside a Combobox
Listbox is commonly used within a combobox for autocomplete and select patterns:Keyboard Navigation
Single Selection
- Arrow Up/Down - Navigate between options (vertical)
- Arrow Left/Right - Navigate between options (horizontal)
- Home - Focus first option
- End - Focus last option
- Space/Enter - Select focused option
- Type characters - Jump to matching option
Multiple Selection
- Shift+Arrow - Extend selection range
- Ctrl+Arrow - Move focus without changing selection
- Ctrl+Space - Toggle selection of focused item
- Ctrl+A - Select all items
Accessibility Features
- Implements ARIA listbox pattern
role="listbox"on containerrole="option"on itemsaria-selectedfor selected optionsaria-disabledfor disabled optionsaria-multiselectablefor multi-selectaria-activedescendantfor virtual focusaria-orientationfor layout direction- Full keyboard navigation
- Screen reader announcements
Use Cases
- Dropdown select menus
- Autocomplete results
- Multi-select lists
- Filterable option lists
- Command palettes