T
11

Our button component had 37 props and nobody could use it

At my company in Portland, our button component grew this huge list of props over two years. I counted 37 different options for size, color, variant, icon position, loading state, and on and on. Last month a junior dev spent three hours trying to wire up a simple submit button and almost cried. We finally sat down, cut it down to 8 props, and made a decision tree chart so anyone can pick the right one in 30 seconds. Has anyone else dealt with a component that got too complicated?
2 comments

Log in to join the discussion

Log In
2 Comments
jordangibson
Funny you mention that, we had almost the same mess with our dropdown component. Over a year and a half it picked up props for everything - custom animations, async loading indicators, search callback functions, you name it. Thing got so bad that even senior devs would just copy paste old code instead of trying to read the docs. What finally worked for us was locking the lead dev out of the component repo for two weeks and letting the two junior guys rebuild it from scratch with a hard limit of 10 props. They came back with something way simpler that handled 95% of our cases and we just wrote a short helper for the weird edge cases nobody actually used anyway.
7
val_taylor
val_taylor12d ago
Reminds me of a toaster I fixed once that had 23 buttons for two functions.
5