Outline updated November 2026
Svelte Essentials
Class Duration
21 hours of live training delivered over 3 days
Student Prerequisites
- JavaScript programming experience
- HTML experience
- Experience with CSS is helpful but not required
Target Audience
Web developers who are new to Svelte and want to build applications with SvelteKit. Teams continuing on can move to Svelte Pro Techniques, and teams adding a backend can move to Full-Stack Web Development with SvelteKit.
Description
This course teaches Svelte and SvelteKit from the ground up. Students learn runes for reactivity, callback props, snippets for passing markup, and attachments for reusable DOM behavior. They build SvelteKit apps with file-based routing, load functions, form actions, and TypeScript. Coverage includes server-side rendering, prerendering, error pages, and a first look at the experimental async features. Migration notes show pre-runes patterns so students can read existing code.
Learning Outcomes
- Explain how Svelte's compiler and runes differ from React, Vue, and Angular.
- Set up a SvelteKit project with
npx sv create, Vite, and TypeScript. - Build pages, layouts, and API routes with SvelteKit file conventions.
- Load data with server and universal load functions.
- Apply
$state,$derived,$effect, and$propsto the right jobs. - Compose components with typed props, bindable props, and snippets.
- Add reusable DOM behavior with
{@attach}attachments. - Build forms with form actions, validation, and
use:enhance. - Share state with
.svelte.tsmodules, context, and$app/state. - Read pre-runes Svelte code and migrate it to current patterns.
Training Materials
All students receive comprehensive courseware covering all topics in the course. Courseware is distributed via GitHub in the form of documentation and extensive code samples. Students practice the topics covered through challenging hands-on lab exercises.
Software Requirements
Students will need a free, personal GitHub account to access the courseware. Students will need permission to install Node.js and Visual Studio Code on their computers. Also, students will need permission to install NPM Packages and Visual Studio Code extensions. If students are unable to configure a local environment, a cloud-based environment can be provided.
Software versions: Svelte 5 and SvelteKit 3 with Vite 8, TypeScript 6, and Node.js 22.17 or later.
Training Topics
Introduction to Svelte
- What is Svelte? What problem does it solve?
- Runes and explicit reactivity
- Svelte vs. React, Vue, and Angular
- The Svelte compiler
- SvelteKit, the official app framework
Development Environment
- Requirements
- Project scaffolding with
npx sv create - Adding tooling with
sv add src/routes,src/lib, and#libimports- Configuring SvelteKit in
vite.config.ts - Svelte extensions for VS Code and JetBrains
- TypeScript and
svelte-check - The generated
$app/tsconfig - Vite dev server and HMR
SvelteKit Overview
- File-based routing
- Server-side rendering and hydration
- Prerendering and static pages
- Adapters and deployment targets
- Unit testing with Vitest
- End-to-end testing with Playwright
Getting Started
- Exploring the Svelte playground
- Layout, page, and component files
- Markup, expressions, and attributes
- The
classattribute with objects and arrays class:andstyle:directives- Compiling Svelte files
Static and Dynamic Pages
- Static pages and prerendering
- Head content with
<svelte:head> - Scoped and global CSS
- Images with
@sveltejs/enhanced-img - Client-side rendering vs. SSR
{#if}and{#each}blocks{#await}and{#key}blocks- Declaration tags for local values
- Debugging with
{@debug}and$inspect
Reactivity with Runes
- The four core runes
$statefor values, objects, and arrays$derivedand$derived.by$effectfor side effects$state.rawand$state.snapshot- Reactive state in
.svelte.tsmodules - Migrating
$:statements to runes
Component Basics
- Component file structure
- Props with
$props()and TypeScript - Default values and rest props
- Bindable props with
$bindable() - Migrating
export letto$props()
Component Composition
- Nested components
- Snippets with
{#snippet}and{@render} - The
childrensnippet - Snippet parameters
- Passing data and callbacks to children
- Component tree best practices
- Migrating slots to snippets
Event Handling
- DOM event attributes such as
onclick - Event modifiers as wrapper functions
- Callback props for component events
- Forwarding handlers with spread props
- Migrating
on:andcreateEventDispatcher
Data Binding
bind:value,bind:checked, andbind:group- Bindable props with
$bindable - Element references with
bind:this
Attachments
- What attachments are
- Adding behavior with
{@attach} - Attachment factories with parameters
- Cleanup functions
- Actions with
use:in existing code
Forms
- HTML form elements
- Named form actions in
+page.server.ts - Returning errors with
fail() - Progressive enhancement with
use:enhance - Handling form results
Lifecycle and Effects
$effectand$effect.pre- Effect cleanup functions
onMountandonDestroytick()for awaiting DOM updates
State Management
$stateas the default choice- Shared state in
.svelte.tsmodules - Sharing state with context
- Page and navigation state with
$app/state - When stores still make sense
- Migrating from
$app/stores
Routing
- File-based routing in SvelteKit
- Route parameters and matchers
- Layouts and route groups
- Server load functions in
+page.server.ts - Universal load functions in
+page.ts - API routes in
+server.ts - Navigation with links and
goto
Errors and Redirects
error()andredirect()helpers+error.sveltepages- Expected vs. unexpected errors
- Fallback errors
Asynchronous Data
- Promises and
{#await}blocks - Load functions returning promises
- Streaming non-essential data
- Experimental
awaitin components <svelte:boundary>pending states- Experimental remote functions