Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

TabList

  • Stable
  • WCAG 2.2 evidence
  • RTL

The row of tabs inside Tabs. Built on React Aria TabList: role tablist with aria-orientation; one tab is in the tab order, the arrow keys move between tabs (mirrored in right-to-left locales), Home and End jump to the ends, and Tab leaves the list for the panel (WCAG 2.1.1, 4.1.2). It passes its variant to the tabs. Many tabs scroll horizontally inside the list, with the native scrollbar as the visible affordance, so the page reflows at 320 px (1.4.10) and the focused tab is scrolled into view (2.4.11). Figma advises a menu or vertical tabs beyond 7 tabs. Consumer duties: a name for the list and labels that match the panels.

import { TabList } from "@nexera-ui/react";
Loading example…
5
examples
9
props
1
live controls
1
platform
5
WCAG criteria
4
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
variant
Generated code
import { TabList } from "@nexera-ui/react";

<TabList />

Examples 4

The same examples as Storybook, rendered live. Open Code to copy one.

Variants

The three Figma variants. Pill hugs its tabs; Underline and Enclosed span the container.

Loading example…

Overflow

More tabs than fit: the list scrolls horizontally inside itself (the scrollbar is the visible affordance) and the focused tab is scrolled into view, so the page still reflows at 320 px. Figma advises a menu or vertical tabs beyond 7 tabs.

Loading example…

Manual activation

keyboardActivation="manual" on Tabs: the arrow keys move focus, Enter or Space shows the panel (for slow panels).

Loading example…

Vertical

<Tabs orientation="vertical"> with VerticalTabs: a column beside the panel; up and down arrows move between tabs.

Loading example…

Props 9

Press "Try it" on a card to load that prop into the playground.

9 props shown

variantNexera
"underline" | "pill" | "enclosed"

Look of the list and of every Tab in it. A tab's own variant wins. Ignored by a vertical list (<Tabs orientation="vertical">), which is a plain column of VerticalTabs.

Default "underline"
classNameNexera
string

Extra classes, merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style.

Default –
aria-labelNexera
string

Accessible name of the tab list ("Employee sections"). Translate it. Accessible name; aria-labelledby wins when both are set.

Default –
aria-labelledbyNexera
string

Id(s) of element(s) that name the list; wins over aria-label. Id(s) of the visible element(s) that name the list, for example the page heading.

Default –
childrenReact Aria
ReactNode | ((item: T) => ReactNode)

The contents of the collection.

Default –
itemsReact Aria
Iterable<T>

Item objects in the collection.

Default –
dependenciesReact Aria
readonly any[]

Values that should invalidate the item cache when using dynamic collections.

Default –
aria-describedbyReact Aria
string

Identifies the element (or elements) that describes the object.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

3 direct · 2 supporting
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.4.10ReflowLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.11Focus Not Obscured (Minimum)Level AA · supporting test
  • 4.1.2Name, Role, ValueLevel A · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

Usage
<TabList className="shadow-sm" />

Used in blocks

Related components