SvelteKit helps you build fast websites and apps easily. It handles loading pages, routing, and server tasks so you can focus on your code.
SvelteKit overview
<script> import { page } from '$app/stores'; export let data; // Your component code here </script> <main> <h1>Welcome to SvelteKit</h1> </main>
SvelteKit uses +page.svelte files for pages and +page.js or +page.server.js for loading data.
Routing is file-based: the file location matches the URL path automatically.
// +page.svelte <script> export let data; </script> <h1>{data.title}</h1>
// +page.js export function load() { return { title: 'Hello from SvelteKit!' }; }
// src/routes/about/+page.svelte
<h1>About Us</h1>
<p>This page is at /about URL automatically.</p>This example shows a page that loads a message from the server and displays it. The load function runs before the page shows, so the message is ready immediately.
// src/routes/+page.js export function load() { return { message: 'Welcome to SvelteKit!' }; } // src/routes/+page.svelte <script> export let data; </script> <main> <h1>{data.message}</h1> <p>This page loads data and shows it.</p> </main>
SvelteKit combines server and client code smoothly, so you can write less and do more.
It supports many deployment targets like static sites, serverless functions, and Node.js servers.
Use the src/routes folder to organize your pages and APIs by URL.
SvelteKit is a tool to build fast, modern web apps with less setup.
It uses file-based routing and load functions to manage pages and data.
It works well for both simple websites and complex apps with server logic.