Tabs
ARIA tabs with manual activation and three appearances.
Live preview
Source
The exact file rendered in the preview above.
components/demos/tabs.tsx
components/ui/tabs.tsx
Demo source — adapt to your project. Foundry is not published as a package.
Usage
For switching between views of the same subject. Manual activation is the default: arrow keys move focus, Enter or Space activates — so arrowing past three tabs does not mount three panels.
- Tabs are for peer content. If one view is primary and the others are detail, use a page instead.
- Keep labels to one or two words; the list scrolls rather than wrapping.
- Only the selected tab is in the tab order — the group is a single tab stop.
Variants and states
Every entry below is a genuine difference in behaviour or layout, and every one of them is visible in the preview above.
- Underline
- Enclosed
- Pill
- With badge
- Disabled tab
Accessibility
- Roles
- `tablist`, `tab` and `tabpanel` with `aria-selected` and `aria-controls` wired in both directions.
- Keyboard
- Arrow keys move, Home and End jump, Enter or Space activates.
- Panel focus
- The panel is focusable so keyboard users land in the content after activating.
Foundry implements published ARIA patterns and is tested against them. No WCAG certification is claimed — see the accessibility documentation for what is and is not covered.
Related
All componentsBreadcrumb
A hierarchy trail with a collapsing middle for deep paths and horizontal scroll on mobile.
starter3 variantsStepper
Multi-step progress in horizontal and vertical orientations, with state conveyed in words as well as ticks.
starter3 variantsDropdown menu
The ARIA menu-button pattern with grouped items, roving focus, shortcuts and destructive styling.
intermediateFeatured6 variants