Replies: 12 comments 6 replies
-
|
Shadcn/ui is not a normal component package. The new npm package called "shadcn" is only a CLI tool. Because of this setup, the CLI may insert extra CSS imports like: That is why the Switch component did not work until that CSS was included. This change is intentional and not an oversight. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the reply @shafisma. It's only being added when running |
Beta Was this translation helpful? Give feedback.
-
|
So, This now behaves like a documentation gap, not a philosophy shift. |
Beta Was this translation helpful? Give feedback.
-
|
This is quite unusual for shadcn. And there isn't even a mention of creating the file manually in the documentation. Is the change made to increase the npm downloads vanity metric. |
Beta Was this translation helpful? Give feedback.
-
|
I can't get it. Our CI runs npm audit --audit-level=moderate as a security gate. The audit fails, and we can't deploy. The vulnerable packages are a web The dependency chain: I never expected a UI component library to bring a web server framework into my dependency tree. The philosophy of shadcn/ui was "copy the code, own it", no extra dependency unless the component required. But now I'm forced to install 241 packages including an MCP SDK and an HTTP framework — just to import a file containing accordion keyframes, Radix data-attribute variants, and a no-scrollbar utility. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @shadcn I would love to get your input on this. As you replied in this PR #10435 which addressed my "issue" #10415 This is an intentional choice. As several people have described above this breaks the "copy the code, own it" promise that is fundamental to the project. It also introduces a massive amount of (heavy) dependencies by installing the entire project. Shadcn/ui already needs and modifies a "globals.css" file, why can't these rules be added there? This seems like a very hefty price to pay. |
Beta Was this translation helpful? Give feedback.
-
|
I find most of these custom variants to be problematic. I only ended up in this thread after spending a bunch of time debugging why when I used I even went and debugged the separator code itself and eventually realized that I would be more understanding if this were namespaced like |
Beta Was this translation helpful? Give feedback.
-
|
With all of these dependabot issues lately I opted to just hardcode these in |
Beta Was this translation helpful? Give feedback.
-
|
You either die a hero, or you live long enough to see yourself become the villain. This definitely looks like an intentional philosophy change for the AI era |
Beta Was this translation helpful? Give feedback.
-
|
Check out the May 2026 - shadcn eject entry here in the changelog: https://ui.shadcn.com/docs/changelog. I stumbled accross this today by chance. |
Beta Was this translation helpful? Give feedback.
-
|
It seems to me a pretty big change to force the components to be unusable out of the box without installing the dependency I am curious to hear, from the creator's point of view, as to why this dependency was introduced, as well as the lack of documentation of it, especially on the components. |
Beta Was this translation helpful? Give feedback.
-
|
Hi everyone. I go over why I had to do this in https://ui.shadcn.com/docs/changelog/2026-05-shadcn-eject and how you can Let me know if this helps. Happy to answer any question here. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
<Switch/>component doesn't work without@import "shadcn/tailwind.css";. Manual installation doesn't mention that we need to add following toindex.cssIt’s unusual for shadcn to offload logic to an internal npm package. Is this an intentional change in philosophy, or an oversight?
Beta Was this translation helpful? Give feedback.
All reactions