Introduction
Runes
Template syntax
Styling
Special elements
Runtime
Misc
Reference
Legacy APIs
Getting started
We recommend usingSvelteKit, which lets youbuild almost anything. It’s the official application framework from the Svelte team and powered byVite. Create a new project with:
npx sv create myappcd myappnpm installnpm run dev
Don’t worry if you don’t know Svelte yet! You can ignore all the nice features SvelteKit brings on top for now and dive into it later.
Alternatives to SvelteKit
You can also use Svelte directly with Vite by runningnpm create vite@latest
and selecting thesvelte
option. With this,npm run build
will generate HTML, JS, and CSS files inside thedist
directory usingvite-plugin-svelte. In most cases, you will probably need tochoose a routing library as well.
Vite is often used in standalone mode to buildsingle page apps (SPAs), which you can alsobuild with SvelteKit.
There are alsoplugins for other bundlers, but we recommend Vite.
Editor tooling
The Svelte team maintains aVS Code extension, and there are integrations with various othereditors and tools as well.
You can also check your code from the command line usingsv check.
Getting help
Don’t be shy about asking for help in theDiscord chatroom! You can also find answers onStack Overflow.
Edit this page on GitHub llms.txt