4 ms·
HTML needs to really catch up already. Who tf uses checkboxes in 2021? Why isn't there an <input type="slide_toggle"> already that uses the native UI? Instead
by dheera 5y ago
HTML needs to really catch up already. Who tf uses checkboxes in 2021? Why isn't there an <input type="slide_toggle"> already that uses the native UI?
Instead of a shitty div hell to construct a slide toggle, which becomes super laggy if you have to have a scrollable list of 1000 of them.
- recursive 5y agoBut like, it's 2022. Anyway, I've never seen any suggestion that checkboxes are obsolete. They seem easier to use than slide toggles to me. It's easier to tell if they're "on". It's harder for me to remember which direction or color indicates on in a slide. But with a checkbox, it's dead-simple. Simple solution to shitty slide_toggle divs is just use input type=checkbox, since they work perfectly.
- lowercased 5y agoHow about getting tri-state checkboxes?
- withinboredom 5y agoWhat does that even mean? Just use radio buttons and be explicit.
- clairity 5y agocheckboxes do have a third 'indeterminate' state[0], but you can't activate it manually. it's basically 'null' rather than an affirmative 'true'/'false'. [0]: https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate https://developer.mozilla.org/en-US/docs/Web/CSS/:indetermin...
- NoSorryCannot 5y agoI won't argue against the value of a native slide toggle, but they have different semantics compared to a checkbox, in my opinion, and you shouldn't use a slide everywhere you had used a checkbox. Slide toggles would be completely bizarre on a survey, for example. "ah yes I'll just turn on 'member of the armed forces'"
- dheera 5y agoSo provide it as an option damnit! I wasn't suggesting getting rid of checkboxes not sure why everyone makes that assumption <input type="checkbox" ...> <input type="slide_toggle" ...> <input type="range" min="0" max="1000" step="5"> <input type="color"> .... You can have whatever you want, just saying, make modern UI native components accessible via HTML without some CPU-intensive div-react-polyfill-javascript fluff. It's ridiculous that if you need to implement a slide toggle, which is available as a native component, that you try to emulate the shit out of it with some images and CSS and javascript and more div hell for the sliding animation and then even more div hell for the little radiating animation instead of just dropping in the native widget which will do all of that and at way better fps than your emulated version.
- soylentgraham 5y agoInstead of all that hell; just use a checkbox.
- dheera 5y agoPecking accurately at checkboxes while trying to keep your balance on a commuter train is not fun. Slide toggles are much easier to hit accurately. They also are visually easier to understand as an on-off switch. Often people tend to go for design anti-patterns with checkboxes like [X] Mute notifications [X] Large fonts Whereas with slide toggles the on-off semantics are much more obvious and design patterns tend to get forced to a better, simplified pattern: [o--] Notifications [--o] Large fonts (where the toggle is clearly lit up for the "on" state of course)
- croes 5y agoMany slide toogles are bad at showing what means on or off. Checkboxes may be ugly but pretty clear.
- dheera 5y agoCheckboxes are extremely hard to peck correctly on mobile, hence slide toggles.