News for hackers. Stuff that matters.
Re:An HTML Switch Control by deprecative on Thursday February 29, 2024 @08:01AM (#39548728)
Which is what a checkbox is. A switch element seems needlessly duplicative. A checkbox and a switch have the same purpose. I don't mind it entirely after all we have plenty of block level elements that do the same things as one another. This just feels like a solution in search of a problem.
Re:An HTML Switch Control by onion2k on Thursday February 29, 2024 @01:51PM (#39553374)
Not really. A checkbox toggles between two binary states of a single option. A toggle switches between two different options.

UI design isn't simple. You can't just pick basic options. Getting it right takes a lot of effort.

Re:An HTML Switch Control by extra88 on Saturday March 09, 2024 @01:55PM (#39653890)
A switch is not for choosing between two options. It has two states, on and off, and it should be named in a way that makes sense with that in mind ("Dark mode" not "Dark/Light").

A checkbox can actually have 3 states, checked, unchecked, indeterminate/mixed.