Comment by snowmobile

6 hours ago

> 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.

>I suppose accessibility can be considered "features", but I'm strongly suspecting that the overcomplex button has worse accessibility.

Accessibility is incredibly hard to get right, particularly managing screen reader announcements, focus management and form validation. I recently had to build a website that met WCAG 2.1 requirements and it was made significantly easier by using React Aria (https://react-aria.adobe.com/) which is a similarly complex headless component library. To get an idea of the work that goes into making an accessible component, see their blog post about making a combo box where they test 4 different screen readers x 4 different browsers: https://react-aria.adobe.com/blog/building-a-combobox

(I haven't used Radix so I'm unsure how well they do a11y)