Tabs

Onglets horizontaux in-page — chaque onglet affiche un panneau de contenu associé. Pattern ARIA tablist/tab/tabpanel conforme W3C APG, activation automatique au focus. Horizontal in-page tabs — each tab reveals an associated content panel. W3C APG-compliant tablist/tab/tabpanel ARIA pattern, automatic activation on focus.

AperçuPreview

Contenu du panneau « Aperçu ».Panel content for "Overview".

Quand l'utiliserWhen to use

ComposantComponentUsageUsage
agtc-tabsNavigation in-page avec panneau — tablist/tab/tabpanel (ARIA)In-page navigation with panel — tablist/tab/tabpanel (ARIA)
agtc-segmentedRéglage à effet immédiat sans panneau (langue, densité, vue)Immediate-effect setting without panel (language, density, view)

Règles absoluesAbsolute rules

ClavierKeyboard

ToucheKeyEffetEffect
Focus + activation onglet précédent/suivant (circulaire) — mode autoFocus + activate previous/next tab (circular) — auto mode
Home EndFocus premier / dernier ongletFocus first / last tab
Enter SpaceActive l'onglet focusé (toujours, y compris mode manual)Activate focused tab (always, including manual mode)
TabSort du groupe vers le panneau actifExits group to the active panel

Tokens de composantComponent tokens

Token CSSRéférenceReferenceValeurValue
--agtc-component-tabs-default-tab-textsemantic.color.text.secondary#646464
--agtc-component-tabs-default-tab-text-hoversemantic.color.text.primary#202020
--agtc-component-tabs-default-tab-text-activesemantic.color.action.primary#007a68
--agtc-component-tabs-default-indicatorsemantic.color.action.primary#007a68
--agtc-component-tabs-default-bordersemantic.color.border.default#e8e8e8
--agtc-component-tabs-default-border-focussemantic.color.border.focus#007a68
--agtc-component-tabs-default-padding-xsemantic.space.control.padding-x16px
--agtc-component-tabs-default-padding-ysemantic.space.control.padding-y8px

AccessibilitéAccessibility

ImplémentationImplementation

<agtc-tabs label="Documentation Button" selected="overview">
  <div slot="overview">Overview content</div>
  <div slot="tokens">Tokens content</div>
</agtc-tabs>
<script type="module" src="../components/agtc-tabs.js"></script>
<script>
  document.querySelector('agtc-tabs').tabs = [
    { value: 'overview', label: 'Overview' },
    { value: 'tokens',   label: 'Tokens' },
  ];
</script>

DOs et DON'TsDOs and DON'Ts

À faireDo

  • Nommer le tablist avec label="…"Name the tablist with label="…"
  • Positionner le tablist au-dessus du panneauPosition the tablist above the panel
  • Labels concis en casse naturelleConcise labels in natural case

À éviterDon't

  • Utiliser pour un réglage sans panneau (→ agtc-segmented)Use for a setting without panel (→ agtc-segmented)
  • Libellés en MAJUSCULESALL-CAPS labels
  • Un seul onglet (pas de tabs)A single tab (not tabs)

UX Patterns Reference

PatternSource (link)AppliedJustification
Tablist above the panelNN/g — Tabs Used RightMaximum content discoverability
In-page tabs (instant change)NN/gKeeps the user in place
Automatic activation on focusW3C APGPreloaded content — APG recommends auto
ARIA tablist/tab/tabpanelW3C APGStandard accessibility pattern
Arrows + Home/End + roving tabindexW3C APGCompliant keyboard navigation
Labels in natural caseNN/gReadability — never ALL-CAPS
:visited neutralizedADR-047System rule — navigation
Optional href (navigation tabs)NN/gMixed in-page + external link tabs
Contribuer à ce projet Contribute to this project

Ce système est ouvert aux contributions — tokens, composants, décisions architecturales, corrections d'accessibilité ou documentation. Toute amélioration est bienvenue. This system welcomes contributions — tokens, components, architectural decisions, accessibility fixes, or documentation. Every improvement counts.

Voir sur GitHub View on GitHub