# Listbox primitive
Source: https://texuli.com/primitives-page/listbox/
# Listbox
An inline list of options with single or multiple selection.
Import
`import { ListboxRoot, ListboxOption } from '@texuli/primitives/listbox';`
Pattern
[Listbox (WAI-ARIA APG)](https://www.w3.org/WAI/ARIA/apg/patterns/listbox/)
Size budget
4.0 KiB gzip for @texuli/primitives/listbox
Reference
`packages/primitives/docs/prim-listbox.md`
## Live demo
Right to left
Loading the Listbox demo…
## Anatomy
Listbox anatomy: each box holds the parts inside it.
- `ListboxRoot``ListboxOption`
## Behavior checks
`tests/behavior/scenarios/listbox.spec.ts` runs **6 rows** against the Listbox scenario on Chromium, WebKit and the Pixel 7. Each row asserts what a user or assistive technology can observe, held to the WAI-ARIA Authoring Practices pattern.
All 6 rows
- the single listbox is named and exposes its selected option
- pointer activation selects an enabled option
- arrow keys move the active descendant and selection
- the multiple listbox can select more than one option
- disabled options cannot be selected
- the listbox examples have no axe violations
### Limits
- Every row passes on every project; a flaky row gets at most two retries.
- Size: at most 4.0 KiB gzip for `@texuli/primitives/listbox` (`pnpm size`).
- Open-to-focus: p75 at most 150 ms (asserted with `TEXULI_PERF=1`).
Listbox
An inline list of options with single or multiple selection.
- Import
import { ListboxRoot, ListboxOption } from '@texuli/primitives/listbox';- Pattern
- Listbox (WAI-ARIA APG)
- Size budget
- 4.0 KiB gzip for @texuli/primitives/listbox
- Reference
packages/primitives/ docs/ prim-listbox.md
Loading the Listbox demo…
Anatomy
ListboxRootListboxOption
Behavior checks
tests/behavior/scenarios/listbox.spec.ts runs 6 rows against the Listbox scenario on Chromium, WebKit and the Pixel 7. Each row asserts what a user or assistive technology can observe, held to the WAI-ARIA Authoring Practices pattern.
All 6 rows
- the single listbox is named and exposes its selected option
- pointer activation selects an enabled option
- arrow keys move the active descendant and selection
- the multiple listbox can select more than one option
- disabled options cannot be selected
- the listbox examples have no axe violations
Limits
- Every row passes on every project; a flaky row gets at most two retries.
- Size: at most 4.0 KiB gzip for
@texuli/primitives/listbox(pnpm size). - Open-to-focus: p75 at most 150 ms (asserted with
TEXULI_PERF=1).