Routing in Svelte

From the Svelte cheat sheet ยท SvelteKit ยท verified Jul 2026

Routing

File-based routing in SvelteKit

javascript
// File structure
src/routes/
  +page.svelte       // index (/)
  +layout.svelte     // root layout
  about/
    +page.svelte     // /about
  blog/
    [slug]/
      +page.svelte   // /blog/:slug
๐Ÿ“ File-based routing with special files
๐ŸŽฏ Dynamic routes with [param] syntax
๐Ÿ“ฆ Route groups with (name) for organization
๐Ÿ”„ Load functions for data fetching

Continue with Svelte

Save the full cheat sheet or work through every related task.

Back to the full Svelte cheat sheet