Toggle switch control element
- Category
- Web Components
- Type
- New or changed feature
- Status
- No longer pursuing (Chrome No longer pursuing)
- Intent stage
- Start prototyping
WPT details: No tests yet. We can test all behavior of this feature if we have testdriver.send_keys().
Summary
Introduces a new form control element representing a toggle switch.
Motivation
Many UI frameworks have toggle switch controls to represent off/on states and ask a user to change the state. The HTML standard has a checkbox, which is functionally similar to toggle switch control. However they have different semantics, and should have different accessibility roles.
Standards & signals
- Firefox: No signal
- Safari: No signal
- Web developers: Positive — Positive for the feature, but not sure for implementation as a built-in module
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=972476
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=toggle-switch-control-element
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Toggle%20switch%20control%20element
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Toggle%20switch%20control%20element
- Baseline status: https://webstatus.dev/?q=Toggle%20switch%20control%20element
Docs: https://github.com/tkent-google/std-switch/blob/master/README.md
Samples: https://tkent-google.github.io/std-switch/demo.html
Explainers: https://github.com/tkent-google/std-switch/blob/master/README.md