Skip to content

Search

Start typing to search.


Show all pages

Documentation

navigation

Tabs

Switch between views of the same subject, one panel at a time.

Rich widgetNeeds a script for its behavior.

Usage

A tab list of buttons and one panel per tab. The selected tab has aria-selected="true"; the other panels are hidden.

Tuesday at 09:00 with Sam, 90 minutes in the blue car.

HTML

Examples

Unavailable tab

A disabled tab stays visible but cannot be selected; the arrow keys skip it.

Invoice 2026-114 for ten lessons, sent on 3 November.

HTML

Guidance and accessibility

When to use

  • Use tabs for a few views of the same subject that people switch between, such as the overview, route and notes of one lesson.
  • Keep the labels short, and the number of tabs small enough to see at once.
  • Do not use tabs for steps in a process or for navigating to other pages; use links for those.

Accessibility

  • Tabs follow the WAI-ARIA tabs pattern. ca-tabs.js handles the keyboard: the arrow keys move between tabs (mirrored in right-to-left), Home and End jump to the first and last, and a tab opens its panel as soon as it is focused.
  • Only the selected tab is in the tab order (tabindex="0"); Tab then moves into the panel, which has tabindex="0" so it can take focus.
  • Give the tab list an aria-label, and each panel aria-labelledby pointing at its tab.
  • Without the script, only the panel that is not hidden shows. Load ca-tabs.js on every page with tabs.

Classes

Generated from the component contract. Parts use __, modifiers use --.

Classes of the tabs component
ClassKindUse it for
ca-tabsComponentWrapper around the tab list and the panels.
ca-tabs__listPartThe role="tablist" row; it scrolls sideways when the tabs do not fit.
ca-tabs__tabPartA role="tab" button. aria-selected="true" marks the selected one.
ca-tabs__panelPartA role="tabpanel" with the content of one tab.

Skins

The same markup, dressed by each skin. Structure and behavior stay the same; only the look changes.

Base skin

Neutral grayscale starting point; product skins extend it and change what differs.

Tuesday at 09:00 with Sam, 90 minutes in the blue car.

Calaca skin

The Calaca UI brand: hueso paper and tinta ink, cempasúchil marigold, rosa and jade.

Tuesday at 09:00 with Sam, 90 minutes in the blue car.

Proof skin

Pilot skin pushed far from base: square, heavy, offset shadows, larger targets.

Tuesday at 09:00 with Sam, 90 minutes in the blue car.

Crossview skin

The CrossView proofing table: cool ground, bond-paper sheets, rule-grey hairlines, one red mark.

Tuesday at 09:00 with Sam, 90 minutes in the blue car.

Framework notes

Link the prebuilt stylesheet of your skin next to your brand theme. No build step.

HTML
<link rel="stylesheet" href="theme.css" />
<link rel="stylesheet" href="ca-base.css" />