Skip Navigation

Scott Spence

The new Svelte (sv) CLI, adding Tailwind is simple now

β€’ 3 min read
Hey! Thanks for stopping by! Just a word of warning, this post is 2 years old, . If there's technical information in here it's more than likely out of date.

Aight! With Svelte Summit Fall 2024 done with we got a load of cool new announcements, Svelte 5 being the big one along with the new site and docs! Beautiful!

One of the other big announcements was the new Svelte CLI sv which combines svelte-add with the create svelte command.

So, now rather than searching around for How to Set Up Svelte with Tailwind CSS it’s a couple of commands!

It can be installed as a global dependency or just run with npx.

To scaffold out a new project, I can use the sv CLI and give it a name:

npx sv@latest create my-awesome-project

Then I can add all the things! Check out the options!

npx sv@latest create my-awesome-project
β”Œ  Welcome to the Svelte CLI! (v0.5.7)
β”‚
β—‡  Which template would you like?
β”‚  SvelteKit minimal
β”‚
β—‡  Add type checking with Typescript?
β”‚  Yes, using Typescript syntax
β”‚
β—†  Project created
β”‚
β—†  What would you like to add to your project?
β”‚  β—» prettier (https://prettier.io)
β”‚  β—» eslint
β”‚  β—» vitest
β”‚  β—» playwright
β”‚  β—» tailwindcss
β”‚  β—» drizzle
β”‚  β—» lucia
β”‚  β—» mdsvex
β”‚  β—» paraglide
β”‚  β—» storybook
β””

So I can go select ALL them things!

But I’ll just go with the defaults I always pick so that I can go over the other command:

npx sv@latest create my-awesome-project
β”Œ  Welcome to the Svelte CLI! (v0.5.7)
β”‚
β—‡  Which template would you like?
β”‚  SvelteKit minimal
β”‚
β—‡  Add type checking with Typescript?
β”‚  Yes, using Typescript syntax
β”‚
β—†  Project created
β”‚
β—†  What would you like to add to your project?
β”‚  β—Ό prettier
β”‚  β—Ό eslint
β”‚  β—Ό vitest
β”‚  β—Ό playwright (https://playwright.dev)
β”‚  β—» tailwindcss
β”‚  β—» drizzle
β”‚  β—» lucia
β”‚  β—» mdsvex
β”‚  β—» paraglide
β”‚  β—» storybook
β””

That’ll create my project, and the thing is, most of the use cases here will be people that already have a project and want to add Tailwind.

Now I’ve already got the project created, so I can just add Tailwind with the add command:

npx sv@latest add tailwind
β”Œ  Welcome to the Svelte CLI! (v0.5.7)
β”‚
β—†  Which plugins would you like to add?
β”‚  β—» typography (@tailwindcss/typography)
β”‚  β—» forms
β”‚  β—» container-queries
β”‚  β—» aspect-ratio
β””

Notice that I used the tailwind keyword in the command, this will prompt for additional plugins to configure with it!

Alternatively, I can just run npx sv@latest add and then select Tailwind from the list along with anything else I’d like to configure!

Super neat!

It’s early days for the new CLI and I have found an issue configuring MDSveX but it’s only going to get better from here with the prospect of community additions on the roadmap!

There's a reactions leaderboard you can check out too.

Sign up for the newsletter

Want to keep up to date with what I'm working on?

Join other developers and sign up for the newsletter.

I care about the protection of your data. Read the Privacy Policy for more info.

Copyright Β© 2017 - 2026 - All rights reserved Scott Spence