← Back to release summary

<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

Ecosystem

Explainers: https://open-ui.org/components/switch.attribute.explainer

View on chromestatus.com