Replies: 5 comments 4 replies
|
The more I looked into it, this does not really seem possible. I like that shadcn has added shadcn/create but this seems to be going the opposite direction of using it to build your own registry. Now it even comes with node modules installed, so not really what it used to be. I hope moving forward shadcn gets back to making features for devs that are making there own registries. |
|
You can create presets without Here's the approach:
For multiple presets (marketing vs. dense app UI), you'd create separate style CSS files in your registry, each mapping the It's more manual setup than |
|
So I transfered all the settings of a preset from shadcn/create and turned them into a registry:base item, which is cool. But based on the command above: npx shadcn@latest init http://your-domain/r/your-registry.json Its not going to allow for more than one registry:base item per registry. Or does it? Lots of trial and error to figure this stuff out. Anyone have any ideas? Does someone know if there is support for more than one registry:base per registry? |
|
You've already discovered the key pieces yourself (registry:base, the init command pointing to a custom URL), so I'll focus on the question you're still stuck on: can one registry support multiple presets without duplicating components? The short answer is yes, but the approach you need is slightly different from what you've been trying. The core issue you hit When you switch presets, The pattern that works: one base, multiple CSS layers Instead of using presets to swap component files, keep a single set of components (installed with one style) and use CSS layers to provide the visual differentiation: Your registry serves one set of components. Consumer projects pull those components, then apply the appropriate CSS layer override on top. The CSS layer overrides target Why this beats multiple presets
The registry:base approach you found Your discovery that If you really need per-archetype component files If the visual differences are too extreme for CSS overrides alone (completely different markup structure, different component compositions), then separate registries per archetype is actually the cleaner approach: Both registries share the same underlying Radix + shadcn structure, but each ships its own inlined classes. This is more maintenance but gives complete freedom. For most teams, the CSS layer override approach (shared components + per-archetype CSS) strikes the right balance between consistency and flexibility without the maintenance burden of per-preset component files. |


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Presets could be really useful for a company that wants to make a multi-architype design system. So say you have Marketing sites with more whitespace, fancy fonts, and high-ratio typescale. On the otherhand, you have web apps that are more ui dense and smaller ratio typescale.
With presets you could have both options while still sharing the same components and themes. I wonder if anyone else has thought of this. It would be cool to have one custom registry power multiple presets that are easily installed with the shad command line. Does anyone know if it is possible to tap into presets power without using shadcn/create?
All reactions