Quick start with SvelteKit
The recommended way to start building with Svelte is using SvelteKit, the official application framework powered by Vite. SvelteKit provides routing, server-side rendering, and other features that make building full-featured applications straightforward.Create a new project
Run the The interactive CLI will guide you through selecting project options including TypeScript support, linting, and testing setup.
sv create command to scaffold a new project:Start the development server
Launch the development server with hot module replacement:Your app will be available at
http://localhost:5173Don’t worry if you don’t know all of SvelteKit’s features yet! You can focus on learning Svelte itself first and explore SvelteKit’s routing, SSR, and other capabilities later.
Understanding the example
Let’s break down the Counter component:Reactive state with $state
$state rune creates reactive state. When count changes, Svelte automatically updates any part of the UI that depends on it. No need for setState or similar functions — just use regular assignment:
Event handling
onclick, onkeydown, etc.) and accept inline functions or references to functions defined in your <script> block.
Template expressions
{} let you embed JavaScript expressions directly in your markup. Svelte efficiently tracks which expressions depend on which state and updates only what’s necessary.
Scoped styles
The<style> block is automatically scoped to this component. The button selector only affects buttons in this component, not buttons elsewhere in your application.
Alternative setup with Vite
If you prefer a minimal setup without SvelteKit’s features, you can use Svelte directly with Vite:Editor setup
For the best development experience, install the official Svelte extension for your editor:VS Code
Install the Svelte for VS Code extension for syntax highlighting, IntelliSense, and diagnostics.
Other editors
Check Svelte Society for plugins supporting JetBrains IDEs, Vim, Emacs, and more.
Command-line type checking
You can check your code for errors from the command line:Next steps
Svelte files
Learn about the structure of .svelte component files
Runes
Understand Svelte’s reactivity system with runes
Template syntax
Explore Svelte’s powerful template features
SvelteKit docs
Dive into full-stack development with SvelteKit
Getting help
Join the friendly Svelte community:- Discord: Join the Svelte Discord for real-time help and discussion
- Stack Overflow: Browse and ask questions tagged with svelte
- GitHub: Report issues or contribute on GitHub