Use without preset style? #10236
Replies: 4 comments 5 replies
-
|
Yes, you can use shadcn components without the preset styles. The approach is:
The components output markup with class names like For example, create your own .cn-button {
@apply your-custom-classes-here;
}Alternatively, if you want even more control, you can eject/copy the component source files (they live in your project after |
Beta Was this translation helpful? Give feedback.
-
|
@DexterHill0 Have you made any progress on your project? I too am dealing with similar issues. Months ago, before presets and the new CLI came along, I made a custom registry. Now I am trying to figure out how to update my registry to be compatible with how the updated shadcn works. |
Beta Was this translation helpful? Give feedback.
-
|
yeah I tried doing something similar once 😅 short answer: nope, there’s no built-in way to do that with the CLI right now. it always spits out components with all the Tailwind classes baked in. there’s no flag or option to get like “bare” components with just cn-* hooks or whatever. what I ended up doing was basically:
a bit painful at first, but after a couple components it’s not that bad tbh. also yeah, those would be pretty cool if they allowed custom style presets though, feels like a missing piece tbh. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use shadcn because it will provide me with a lot of the ground work in terms of wrapping all radix primitives, giving them the right slots, prop types, general layout styles, and so on. However, the preset styles, and even custom tailwind theme variables, do not provide me with enough customisation for my use case as I need to follow fairly strict design rules.
Reading the
shadcnsource, I can clearly see the radix primitives are mostly just given class names likecn-*and the preset styles are simply css files that define tailwind classes for all those class names (such asregistry/styles/style-lyra.css).Is there any way for me to write my own one of these css files? I can't seem to find a way, in the CLI, to generate components with the raw
cn-*class names, so I'm assuming not, but it would be extremely nice if I could.Beta Was this translation helpful? Give feedback.
All reactions