<input type="checkbox" switch>
- Category
- DOM
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
This proposal adds a switch attribute to <input type="checkbox"> for binary on/off settings. The control reuses the checkbox's checked state, form participation, and label association while exposing it as a switch to assistive technologies. It provides a platform-native appearance and supports familiar click, keyboard, and touch interactions. Authors can customize the track and thumb using proposed CSS pseudo-elements, with animation supplied by the user agent. The attribute targets common switch use cases. Cases requiring child content are not supported by the attribute, and a standalone <switch> element is out of scope for this proposal.
Motivation
Switches are common in settings, preferences, feature controls, and consent interfaces, but the HTML Standard does not currently define a native switch control. Developers instead rely on JavaScript component libraries, visually hidden checkboxes with custom CSS, or generic elements with role="switch". Depending on the approach, developers may need to recreate accessibility semantics, keyboard handling, state management, or form participation. These approaches can result in inconsistent behavior and accessibility, fragile implementations, and unnecessary JavaScript costs.
Standards & signals
- Specification: https://github.com/whatwg/html/pull/9546
- Firefox: No signal
- Safari: Shipped/Shipping
- Web developers: No signals
- Tracking bug: https://issues.chromium.org/issues/41484737
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=input-type-checkbox-switch
- 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+%3Cinput%20type%3D%22checkbox%22%20switch%3E
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=%3Cinput%20type%3D%22checkbox%22%20switch%3E
- Baseline status: https://webstatus.dev/?q=%3Cinput%20type%3D%22checkbox%22%20switch%3E
Explainers: https://open-ui.org/components/switch.attribute.explainer