r/reactjs • u/Ok-Willingness4768 • Jul 06 '26
Discussion How are you handling shadcn/ui customization in production apps without it becoming unmaintainable?
/r/nextjs/comments/1up5l03/how_are_you_handling_shadcnui_customization_in/
3
Upvotes
2
u/_suren Jul 07 '26
I treat shadcn as owned code, but with a rule: don’t casually edit the base primitive every time a screen needs something.
For app-specific stuff I usually make a wrapper or a named variant, then leave the primitive boring. Otherwise six months later nobody knows whether a change was a design-system decision or one page being weird.
0
u/Honey-Entire Jul 06 '26
You didn't include any code so this is the best I can do to help without more context:
This sounds like you need to learn about composition instead of inheritance. The only time downstream components should break when you make changes is because you introduced breaking changes (e.g. removing a prop or changing it's possible values). If you're components are breaking because they're inheriting props from upstream components then you're going to experience this a lot.
Don't do that? Like, if you have problems with name collisions, find a better way to name your things. This is why there's a long-running joke one of the hardest things in software development is naming things.
It sounds like it's time to invest in learning how to build & maintain your own design system instead of fighting the constraints of someone else's opinionated library. If you don't have enough control, you need to build the controls you need.
What? Are you doing code review? Are you looking at the git blame? Git tracks changes so it's easy to see the history of changes made to a file.
The whole point of shadcn is it copies the core code into your project so you can maintain your own custom components. If you want to use shadcn, plan on editing the base components. If you want to use other libraries like Material or Bootstrap, wrap their components with custom wrappers to protect yourself against changing APIs or the eventual need or desire to swap out entire design systems.