VanillaReactLight & dark425 views
A toggle switch whose sliding thumb cross-fades a check icon when on and an x icon when off, with `role="switch"` semantics and full keyboard support — fully design-system agnostic.
Get the code for free
Create a free account to copy or download the full source.
Switch component
A toggle switch whose sliding thumb cross-fades a check icon when on and an x icon when off, with `role="switch"` semantics and full keyboard support — fully design-system agnostic.
transform: translateX for GPU-friendly motionopacity as the thumb movesrole="switch" semantics with aria-checked synced on every changearia-liveprefers-reduced-motion<button> with role="switch" and aria-checkedaria-hidden="true"aria-live="polite" announces Enabled/Disabled changes:focus-visible with --ring outline on all interactive elementsprefers-reduced-motion: reduce disables all animationsOpen Switch Icon in Atheros AI Builder, pick a design system and ask the AI assistant to change the layout, copy or behaviour — the switch is regenerated against your tokens. Take the HTML, CSS, JS and React source with you, or pull it into your repo from Claude Code, Cursor or Codex over MCP.
Starting at $9.9 per month, billed annually
Don't miss a beat with our newsletter!
BUILDER
ABOUT US
© 2026 Atheros Intelligence Ltd.