| ▲ | caseyross 6 hours ago | |||||||
This is only "overcomplex" from a naive point of view. Radio buttons, as with all UI controls, have tremendous inherent complexity, which comes to light once requirements ask for something beyond the blessed happy path of the default browser button. Pixel perfect styling, animations, focus behaviors, interactions with external state, componentized branding to fit in with companies' ecosystems, etc. The baseline <input> paradigm struggles to provide the tools needed to adequately handle this complexity, even today, after many decades of web development. And of course --- you can also argue that we should all just use the default browser button and everything should be solved. But this is also suboptimal, as it's clear from research that users prefer custom buttons if they provide more "features" than the defaults. | ||||||||
| ▲ | snowmobile 6 hours ago | parent | next [-] | |||||||
> it's clear from research that users prefer custom buttons if they provide more "features" than the defaults. Hate to be asking for a "source", but what research? And what "features" can a radio button even have? You click it and it's selected. I suppose accessibility can be considered "features", but I'm strongly suspecting that the overcomplex button has worse accessibility. > all UI controls, have tremendous inherent complexity Well, this is true in a sense, but it's not exactly a good argument for re-implementing all that complexity in JS / HTML, instead of simply using the browser's implementation that's written in a real language. | ||||||||
| ||||||||
| ▲ | invalidusernam3 6 hours ago | parent | prev [-] | |||||||
Agree, this kind of complexity is there for a reason. I would rather have a complex component that handles all the cases within its usage in the codebase over having a bunch of little hacks/changes in the usage. It's far easier to maintain one complex component than many different usages of that component. And you don't have to use such a complex component library if you don't need it. For small codebases it often is overkill. But for large codebases it's a massively worthwhile investment. | ||||||||