logoalt Hacker News

chvidtoday at 6:15 AM17 repliesview on HN

For boring applications - do people prefer the copy paste approach of shadcn instead of a traditional ui library like mantine?

The copy paste approach may be easily modifiable but creates new problems - ie now there is an upgrade ai agent for something that should just be ticking up a version number.


Replies

oneneptunetoday at 3:23 PM

"just ticking up a version number" drastically understates the headaches of Material UI over the years.

Not a boring application, a very large application -- each major version update was a tedious process because they completely upended many APIs.

We've migrated to shadcn, and upgrades are now easy; we can upgrade a single component -- add the new ones free.

With MaterialUI we had to update EVERYTHING to their new APIs to be able to take advantage of the new features anywhere.

With shadcn we can be selective.

show 1 reply
stevepottertoday at 12:34 PM

I never understood the copy paste thing. Shadcn just reeks of a fad, and even after doing copy paste and trying it, I didn’t see what the big deal was. But enjoy it, y’all. One of the benefits of AI is that HN isn’t clogged with talk of JavaScript frameworks as much

notpushkintoday at 6:36 AM

I’m leaning towards vendoring for all my new projects.

Grabbing an off-the-shelf UI library is easy in the short term, but it’s usually overcomplicated, implements things I won’t ever need, is hard to tweak if/when you want to distinguish your app from the thousand others using the same library, and when you do decide to upgrade it, all your tweaks break in subtle ways.

What I think would be the best approach is building your own UI library. You own it, you get to reuse it across different projects and maintain the same visual style (if desired), and you add features when you need them.

show 1 reply
Exoristostoday at 6:31 AM

Mantine is brilliant, I can build anything in it quickly and then extend it or completely customize the theme or individual components, but there is a learning curve. I would not call it a giant learning curve.

show 2 replies
lucumotoday at 8:37 AM

> that should just be ticking up a version number.

Ah, but it's rarely just that in many systems. It can only be just that if the component library does exactly what you want. Unfortunately, it happens quite often that component doesn't entirely do what's needed.

People bolt on extra CSS to the components all the time. Two lines of CSS is very tempting if the alternatives are a few hours of work at least. But those two lines need to be verified against every new feature of the component library.

Do those two line fixes a lot, and upgrading becomes A Project.

andrewingramtoday at 4:04 PM

I think it depends on the project, but I've found that using installable libraries becomes a bottleneck over time as you find yourself running into their limits, or trying to customise them in ways they really aren't design for.

I wrote something about it a few years ago when shadcn was relatively new on the scene https://andrewingram.net/posts/recipe-kits-a-great-alternati...

slowjamestoday at 10:16 AM

Ticking up a version number is all fine and good until it requires a dependency upgrade you aren’t ready for. If for example you wanted to upgrade MUI from 4 to 5, you’d find react 17 wasn’t supported. And if you weren’t ready or able to upgrade react, then you’d just be stuck using a UI library going more out of date by the day.

With shadcn / the copy paste format, you’ll almost never see that happen. The button shadcn provides for example is just css / tailwind. And if you did ever for some reason want to bring in a dependency for your button component you wouldn’t have to consider its effect on your other UI elements. The rest of your components can live independently (for the most part)

We have customized UI components we got from shadcn and now some use radix and some use base ui, and some have other dependencies or no dependencies at all. Properly tree shaken this is not a big deal at all and we can upgrade components individually as needed.

For boring applications this may be a bit much. But even then if you wait too long and mantine falls behind more than a couple versions, who knows how easy it would be to get your whole project up to date.

rzmmmtoday at 7:52 AM

I don't like the copy paste. Rather use lower-level abstractions for the UI if I know I have to make modifications.

matt-attacktoday at 3:06 PM

Can you explain what copy paste means here?

I use Material UI for all my AI coded applications. Am I doing something wrong? What difference would Shadcnd even make in a world of Claude Code?

Isn’t either infinitely customizable via CSS? So what’s the difference?

show 1 reply
victorbjorklundtoday at 7:22 AM

If you don't need to make any changes, it should be very simple to just upgrade by replacing the components. And if you need to make changes then well it's not gonna work with a traditional UI library.

dbbktoday at 2:54 PM

The copy paste approach is just a plain bad idea, I am not sure why this doesn't get more criticism

sreekanth850today at 8:18 AM

Bigger issue ,every app that use shadcn use 100% same. I still have to figure how people differentiate their brand using shadcn.

Griffinsaucetoday at 11:36 AM

> that should just be ticking up a version imber.

Is it ever that simple?

sevenzerotoday at 6:39 AM

I highly prefer a copy and paste approach. The less npm installs the better.

chrismsimpsontoday at 9:54 AM

As grug, I prefer the paste approach

p-e-wtoday at 9:11 AM

> now there is an upgrade ai agent for something that should just be ticking up a version number.

If a component as basic as a button or a list view ever requires an “upgrade”, something is fundamentally wrong to begin with. HTML5, ARIA, etc. aren’t cutting edge technologies that the ecosystem still needs time to figure out. This should be pull once and forget.

IceDanetoday at 6:23 AM

Martine just straight up sucks.

Vendoring your components gives you the best of both worlds. You get a full component library but retain the ability to modify them as you want.

Your AI agent claim doesn't make any sense either. When upgrading normally your component just gets rewritten on disk. When switching from radix to base ui, a more comprehensive approach is needed.

show 2 replies