LanguageToggle
ImplementedHeader language switcher. Shows the TARGET language token (e.g. "EN" while FR is active); when onChange is provided, toggles FR⇄EN. aria-label always announces the current language and the action so the single visible token stays unambiguous to assistive tech.
components/atoms/LanguageToggle/LanguageToggle.tsxHeader language switcher. Shows the TARGET language token (e.g. "EN" while FR is active); when onChange is provided, toggles FR⇄EN. aria-label always announces the current language and the action.
LanguageToggle
Atoms — controls
Minimal single-token FR/EN toggle. Shows the TARGET language token (not the current one); aria-pressed mirrors EN when interactive, omitted display-only. For header/nav locale switching prefer the LanguageSwitcher molecule (aria-current group, BCP 47 casing, inline/compact variants; the fab variant was retired in ADR-038).
Props
LanguageToggle
value'FR' | 'EN''FR'Currently active language shown on the control
onChange(next: 'FR' | 'EN') => void—Called with the next language when toggled. Omit for a display-only control.
classNamestring''Extra utility classes appended to the button
onClick(event: React.MouseEvent<HTMLButtonElement>) => void—Called when the element is activated.
ariaLabelstring—Override for the built-in English aria-label template, e.g. localized announcement.
<LanguageToggle />Accessibility
Type
1 ruleARIA
1 ruleUsage
Import
import { LanguageToggle } from "@epasslive/design-system"Example 1
<LanguageToggle value="FR" />Example 2
<LanguageToggle value={lang} onChange={setLang} />Anti-patterns
— Do not compose atoms directly — use molecules instead
— Avoid inline styles on atoms