Description
HTML form control that implement native switch functionality using checkboxes. It adds a switch attribute to the input element with a checkbox type.
<input type=checkbox switch>
<input type=checkbox switch checked>
Introduced in Safari 17.4 - https://webkit.org/blog/15054/an-html-switch-control/
It uses the accent-color property and the experimental ::thumb and ::track pseudo-elements. But even without the pseudo-elements, a native switch control replaces lots of CSS and JS currently used by developers.
Native switcher is also accessible by default, as the logic is inherited from the checkbox. We no longer need to implement different patterns for accessibility.
Specification
https://www.w3.org/TR/wai-aria-1.3/#switch
web-feature
No response
Test Links
No response
Additional Signals
https://webkit.org/blog/15054/an-html-switch-control/
Description
HTML form control that implement native
switchfunctionality using checkboxes. It adds aswitchattribute to theinputelement with acheckboxtype.Introduced in Safari 17.4 - https://webkit.org/blog/15054/an-html-switch-control/
It uses the
accent-colorproperty and the experimental::thumband::trackpseudo-elements. But even without the pseudo-elements, a native switch control replaces lots of CSS and JS currently used by developers.Native switcher is also accessible by default, as the logic is inherited from the checkbox. We no longer need to implement different patterns for accessibility.
Specification
https://www.w3.org/TR/wai-aria-1.3/#switch
web-feature
No response
Test Links
No response
Additional Signals
https://webkit.org/blog/15054/an-html-switch-control/