# Tabs primitive
Source: https://texuli.com/primitives-page/tabs/
# Tabs
A tab list where each tab shows one panel.
Import
`import { Tabs } from '@texuli/primitives/tabs';`
Pattern
[Tabs (WAI-ARIA APG)](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/)
Size budget
4.5 KiB gzip for @texuli/primitives/tabs
Reference
`packages/primitives/docs/prim-tabs.md`
## Live demo
Right to left
Loading the Tabs demo…
## Anatomy
Tabs anatomy: each box holds the parts inside it.
- `Tabs.Root``Tabs.List``Tabs.Trigger`
- `Tabs.Content`
## Behavior checks
`tests/behavior/scenarios/tabs.spec.ts` runs **7 rows** against the Tabs 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 7 rows
- a named tablist with tabs, the first selected and its panel shown
- arrow keys move between tabs and show their panels, skipping the disabled one
- Home and End go to the first and last tab
- starting on a later tab, Tab lands on that selected tab, not the first
- after the selection changes, Tab into the list lands on the newly selected tab
- Tab leaves the tablist for the active panel
- a click selects a tab
### Limits
- Every row passes on every project; a flaky row gets at most two retries.
- Size: at most 4.5 KiB gzip for `@texuli/primitives/tabs` (`pnpm size`).
- Open-to-focus: p75 at most 150 ms (asserted with `TEXULI_PERF=1`).
Tabs
A tab list where each tab shows one panel.
- Import
import { Tabs } from '@texuli/primitives/tabs';- Pattern
- Tabs (WAI-ARIA APG)
- Size budget
- 4.5 KiB gzip for @texuli/primitives/tabs
- Reference
packages/primitives/ docs/ prim-tabs.md
Loading the Tabs demo…
Anatomy
Tabs.RootTabs.ListTabs.Trigger
Tabs.Content
Behavior checks
tests/behavior/scenarios/tabs.spec.ts runs 7 rows against the Tabs 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 7 rows
- a named tablist with tabs, the first selected and its panel shown
- arrow keys move between tabs and show their panels, skipping the disabled one
- Home and End go to the first and last tab
- starting on a later tab, Tab lands on that selected tab, not the first
- after the selection changes, Tab into the list lands on the newly selected tab
- Tab leaves the tablist for the active panel
- a click selects a tab
Limits
- Every row passes on every project; a flaky row gets at most two retries.
- Size: at most 4.5 KiB gzip for
@texuli/primitives/tabs(pnpm size). - Open-to-focus: p75 at most 150 ms (asserted with
TEXULI_PERF=1).