Toggle

Interrupteur on/off à effet immédiat — le changement s'applique instantanément, sans bouton « Enregistrer ». L'état est signalé par la position du curseur (indicateur non-couleur, WCAG 1.4.1). Immediate-effect on/off switch — the change applies instantly, no "Save" button. State is signaled by the knob position (non-color indicator, WCAG 1.4.1).

ÉtatsStates

Off · On
Mode sombreDark mode Notifications par e-mailEmail notifications
DésactivéDisabled
SynchronisationSync Sauvegarde autoAuto-save

Checkbox ou toggle ?Checkbox or toggle?

CheckboxToggle
EffetEffectÀ la soumissionOn submitImmédiatImmediate
UsageUseSélection 0–N dans un formulaire0–N selection in a formRéglage on/off instantanéInstant on/off setting
ExempleExample« J'accepte les CGU »« Mode sombre »"Dark mode"

Règles absoluesAbsolute rules

Tokens de composantComponent tokens

Token CSSRéférenceReferenceValeur résolueResolved value
--agtc-toggle-default-track-offprimitive.color.gray.9#8d8d8d
--agtc-toggle-default-track-off-hoverprimitive.color.gray.10#838383
--agtc-toggle-default-track-onsemantic.color.action.primary#007a68
--agtc-toggle-default-track-on-hoversemantic.color.action.primary-hover#0d3d38
--agtc-toggle-default-knobsemantic.color.background.surface#ffffff
--agtc-toggle-default-border-focussemantic.color.border.focus#007a68
--agtc-toggle-default-labelsemantic.color.text.primary#202020

ImplémentationImplementation

<agtc-toggle label="Notifications par e-mailEmail notifications" name="email-notif"></agtc-toggle>
<agtc-toggle label="Mode sombreDark mode" checked></agtc-toggle>

UX Patterns Reference

Patterns approved by the Design System Lead via the ux-pattern-review workflow (see .claude/rules/ux-patterns-sources.md and ADR-036). Decision: all approved.

PatternSourceAppliedJustification
role="switch" + aria-checkedNN/g — toggle switchNative <input type="checkbox" role="switch">
Immediate effect (no submit)NN/gagtc-change emitted on toggle
State by knob position (not color alone)NN/gKnob slides left/right (WCAG 1.4.1)
Delimited knob (contrast ≥ 3:1)NN/gWhite + shadow, gray.9 track (WCAG 1.4.11)
Concise label describing the "on" state, frontloadedNN/glabel writing rule
Clickable label + target ≥ 24pxNN/g · IxDFEnclosing <label>, min-height: 24px
Binary onlyNN/gOtherwise radio/checkbox
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