The Incredible Overcomplexity of the Shadcn Radio Button
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
Modern UI libraries like Shadcn and Radix add significant complexity to simple HTML radio buttons, requiring multiple dependencies, hundreds of lines of React code, and several kilobytes of JavaScript. These libraries rebuild radio buttons from scratch using buttons with ARIA attributes instead of native HTML inputs, despite the fact that radio buttons can be easily styled with basic CSS techniques like `appearance: none`, pseudo-elements, and pseudo-classes. This overcomplexity violates ARIA best practices, increases cognitive load, and degrades performance for a feature browsers have supported natively for 30 years.
Table of contents
Enter ShadcnEnter RadixTaking a look in the browserStyling radio buttons is hard (Wait, is it?)I'm not trying to convince you to write your own component stylesWho cares?It's just a radio buttonWe have strayed so far from the light26 Comments
Sort: