ThemeSwitcher
StableToggle Aurora clair/sombre — 3 variantes : row (pill header), stack (sidebar pleine largeur), icons (compact icône seule). A11y radiogroup, flèches ←/→ (roving tabindex), prefers-reduced-motion.
import { ThemeSwitcher } from "@lyra/tokens/components";Playground
variant="row" — pill horizontale (défaut, header)
variant="stack" — pleine largeur (sidebar)
variant="icons" — compact (icône seule, mobile / espace réduit)
Le toggle s'applique à tout le design system (ThemeProvider). Flèches ←/→ ou clic pour changer.
Démo interactive — réglages du playground (props ajustables en direct) à venir.
// Header
<ThemeSwitcher variant="row" />
// Sidebar
<ThemeSwitcher variant="stack" />
// Compact / mobile
<ThemeSwitcher variant="icons" />Documentation
- variant=row
- variant=stack
- variant=icons
variant, className// Header
<ThemeSwitcher variant="row" />
// Sidebar
<ThemeSwitcher variant="stack" />
// Compact / mobile
<ThemeSwitcher variant="icons" />- role='radiogroup' sur le conteneur — l'ensemble est un groupe de choix exclusifs.
- Chaque option : role='radio' + aria-checked reflète l'état actif.
- Navigation clavier : Flèches ←/→ (roving tabindex) entre les options.
- aria-label décrit l'option active (thème + description) via i18n.
- prefers-reduced-motion : transitions disabled (background / color).
- WCAG 2.1.1 — entièrement opérable au clavier.