13
Everybody loves component variants but I think they are a trap
I spent 6 months building a design system for a 12 person team last year. Every tutorial pushes component variants as the gold standard but they turn into a nightmare when you have more than 4 or 5 states. We ended up with 32 variants for just our button component and nobody could remember which one to use. Instead of variants I started using CSS classes with a single base component and it cut our maintenance time by half. My team fought me on it at first but after 3 sprints they admitted the variant approach was slowing us down. Has anyone else found a breaking point where variants stop being helpful?
2 comments
Log in to join the discussion
Log In2 Comments
riley5952d ago
Blink 32 times and you'll still have too many button variants.
6
rose_murray2d ago
lol oh man this brings back memories of my friend jen who tried variants at her startup and it was an absolute dumpster fire. she was so proud of her fancy button system with like 40 variants including hover + disabled + dark mode combos and then the new dev accidentally used the wrong one and broke the checkout page for 3 days. she switched back to just using css classes with a simple base component and her team actually started shipping features again instead of arguing about which variant to pick. it took her team like 2 sprints to stop complaining but now they joke about the "variant graveyard" in their old codebase.
4