Skip to content
Discussion options

You must be logged in to vote

You don't need init anymore. The PR linked above (#2751) added an apply command, which shipped in shadcn-svelte@1.4.0, so any recent version has it (current is 1.7.0):

npx shadcn-svelte@latest apply <preset-code>

To get a preset code, build your theme at https://shadcn-svelte.com/create. The button there copies --preset <code>, so either of these works:

npx shadcn-svelte@latest apply <code>
npx shadcn-svelte@latest apply --preset <code>

What it does in an existing project:

  • It needs your existing components.json and errors out if there isn't one. It updates the style, base color, icon library and menu settings in that file to match the preset.
  • It pulls the preset from the registry's /init…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@proxie-ghanshyam
Comment options

Answer selected by proxie-ghanshyam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants