Layered sections of content, one visible at a time, chosen from a tab list with the APG keyboard - arrow keys, Home and End, automatic or manual activation.
Layered sections of content, one shown at a time, chosen from a list of tabs. It follows the
WAI-ARIA APG tabs pattern.
Roving focus: the tab list is one tab stop (the selected tab, else the first); the arrow keys
move between tabs, Home and End jump to the first and last, wrapping when loopFocus.
Activation: automatic (the default, the APG's recommendation when a panel shows without
delay) selects the tab focus moves to (reason list-navigation); manual waits for Enter or
Space. A click selects and focuses (reason trigger-press).
Disabled tabs stay focusable, so they can be discovered, but are never selected.
Panels: Tab moves from the tab list to the selected panel, which is a tab stop of its own.
An inactive panel is not rendered, unless keepMounted keeps it, hidden.
Panel transitions: a newly selected panel enters with data-starting-style, the previous one
exits with data-ending-style (and inert) before it unmounts; data-activation-direction
tells a recipe which side to slide from.
Indicator: it exposes the selected tab's box, relative to the list, as CSS variables, for a
line that follows the selection.
RTL: in a horizontal list, ArrowRight and ArrowLeft swap.
Every part also takes what the primitive contract gives. The
names below are React's; Vue binds them as v-model:value and @value-change, Angular as
[(value)] and (valueChangeDetails).
It sets the logical --tabs-indicator-inset-inline-start, --tabs-indicator-inset-block-start,
--tabs-indicator-inline-size and --tabs-indicator-block-size, and the physical
--active-tab-left, --active-tab-right, --active-tab-top, --active-tab-bottom,
--active-tab-width and --active-tab-height (Base UI's names), and is not rendered while no tab
is selected (Angular's *tabsIndicator is structural).
prop
type
default
description
renderBeforeHydration
boolean
false
in a server render, places it before hydration: a small inline script inside it measures the selected tab as the page parses, then removes itself (Server rendering) (Angular: *tabsIndicator="true")
nonce
string
the nonce of that script, so it runs under a Content Security Policy that allows inline scripts by nonce (Angular: *tabsIndicator="true; nonce: cspNonce", else Angular's CSP_NONCE provider)
role="tabpanel", aria-labelledby, tabindex="0", data-selected, data-starting-style / data-ending-style, inert while it exits, hidden when kept mounted and inactive, data-orientation, data-activation-direction
data-activation-direction is where the newly selected tab sits from the previous one: left,
right, up, down, or none before any change. It is physical, as the Indicator's travel: in
RTL the next tab is on the left. A panel that becomes selected renders with data-starting-style
for a frame (not on the first render); one that stops being selected stays, inert, with
data-ending-style until its animations end. Two panels exist together while one exits: stack
them in one grid cell, or animate the enter only.