Toggle switches are now everywhere. Our mobile phones are full of them and we even have them on websites.
It is however is not a built-in feature of browsers. Even though it is fairly easy to implement, you still need to manually integrate them in your code. Popular UI frameworks provide this as a component to use.
A proposal was recently submitted to make this a browser feature. The Chrome team picked this up today and started working on it. Hmm, maybe they were working on this for a while now. The bug for this feature request was opened on 10th June 2019. I see the initial code check-in for this on the same day. If you consider the fact that the original idea was submitted on Nov 19, 2018, it is safe to assume that the Chrome team has been working on this for a while.
How does this work? If you are a developer, you will find all the details you need from these places:
- Specification issue: https://github.com/whatwg/html/issues/4180
- Explainer: https://github.com/tkent-google/std-switch/blob/master/README.md
- WICG thread: https://discourse.wicg.io/t/proposal-a-toggle-switch-control-element/3620
- Tag review: https://github.com/w3ctag/design-reviews/issues/384
- Chromestatus: https://chromestatus.com/features/6624580116414464
- Intent to implement: https://groups.google.com/a/chromium.org/d/msg/blink-dev/kP556piqDR8/XHuly9HMAwAJ
For ordinary web users like us, expect to see toggle switches everywhere on the web because it is going to really easy for developers to implement them. Websites will look more like native applications on the web.
Added to Blink – Will Come to Other Chromium Browsers too
What do you think about this new feature? Let me know in comments.