Svelte Fundamentals
Svelte is a web user-interface framework that compiles components written with HTML, CSS, and JavaScript into browser code. It tracks reactive state so the page updates when application data changes.
itWeb development | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Svelte Fundamentals
Svelte is a way to build browser interfaces from components, with a compiler doing much of the book-keeping before the browser enters the room. A component keeps markup, behavior, and scoped CSS in a .svelte file. The compiler turns those relationships into JavaScript and CSS that update the DOM, which is the browser's tree of page elements. Nobody has to hand-deliver notices to every button.
The important bit is the dependency graph. Props and state are inputs. Markup reads them. A derived value calculates from them. When an event changes state, Svelte knows which part of the rendered page needs attention. This is why a derived value belongs in $derived, not in a second state variable being ceremonially copied around by an effect.
Then there is $effect, the rune for speaking to systems outside Svelte. Use it for a canvas, media player, browser title, or third-party widget. It runs in the browser after rendering, so it cannot supply essential server-rendered content. This distinction is mildly annoying only until it prevents a page from arriving with the wrong answer and correcting itself later, which is the sort of surprise that develops a personality.
Components are also negotiations about ownership. Props carry values downward. A callback reports an interaction upward. A bind: directive permits writing in both directions, which is useful for an input but should not quietly turn every child into co-owner of its parent's state. For a repeating list, give every row a stable key such as task.id; an array index knows where a row is, not who it is.
Read the Intro for the component model, lifecycle, and framework boundary. Use Slides for the flow from a state write to a DOM update. Keep the Cheatsheet nearby when choosing runes, blocks, bindings, and error boundaries. The practice reference and exercise turn that model into a small task list, where reordering data is allowed to reveal whether the code knows the difference between a task and its seat number.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://svelte.dev/docs/svelte/overview
Supports
- Svelte as a compiler-based framework for web user interfaces
- Components compiled from HTML, CSS, and JavaScript into optimized JavaScript
- Standalone components and SvelteKit applications
- https://svelte.dev/docs/svelte/svelte-files
Supports
- Component file anatomy and optional sections
- Instance and module script behavior
- Component-scoped style blocks
- https://svelte.dev/docs/svelte/%24state
Supports
- Reactive state and deep proxy behavior
- Raw state, snapshots, arrays, objects, and class limitations
- Destructuring behavior and cross-module state considerations
- https://svelte.dev/docs/svelte/%24derived
Supports
- Derived values and synchronous dependency tracking
- Side-effect-free derived expressions
- Multi-statement derived calculations
- https://svelte.dev/docs/svelte/%24effect
Supports
- Effect scheduling, dependency tracking, and cleanup
- Browser-only effect execution
- Effects as an escape hatch for external synchronization
- Update-cycle and self-triggering failure behavior
- https://svelte.dev/docs/svelte/%24props
Supports
- Props declared through the props rune
- Fallback values and parent-to-child input flow
- Callback properties as component inputs
- https://svelte.dev/docs/svelte/%24bindable
Supports
- Props being non-bindable by default
- Explicit two-way component bindings
- https://svelte.dev/docs/svelte/if
Supports
- Conditional template branches
- https://svelte.dev/docs/svelte/each
Supports
- Iteration over arrays and iterables
- Keyed identity for inserted, moved, and deleted list items
- Empty-list alternatives
- https://svelte.dev/docs/svelte/await
Supports
- Pending, fulfilled, and rejected promise branches
- https://svelte.dev/docs/svelte/key
Supports
- Destruction and recreation when a key expression changes
- https://svelte.dev/docs/svelte/bind
Supports
- Two-way element property bindings
- Value and checked bindings
- https://svelte.dev/docs/svelte/snippet
Supports
- Reusable parameterized markup snippets
- Passing snippets to components
- https://svelte.dev/docs/svelte/%40render
Supports
- Rendering snippets at a call site
- https://svelte.dev/docs/svelte/scoped-styles
Supports
- Compiler-scoped component selectors
- CSS specificity within scoped styles
- https://svelte.dev/docs/svelte/global-styles
Supports
- Explicit global selector behavior
- https://svelte.dev/docs/svelte/lifecycle-hooks
Supports
- Creation and destruction lifecycle boundaries
- onMount, onDestroy, and tick timing
- Server-rendering behavior of lifecycle hooks
- https://svelte.dev/docs/svelte/context
Supports
- Context initialization and descendant access
- Subtree state and server-side shared-state risks
- https://svelte.dev/docs/svelte/stores
Supports
- Store subscription contract
- Stores as an option for asynchronous streams and manual update control
- Shared rune state in Svelte JavaScript and TypeScript modules
- https://svelte.dev/docs/svelte/svelte-boundary
Supports
- Rendering and effect error handling with a Svelte boundary
- Fallback snippets and error reporting
- Exclusion of event and later asynchronous errors
- https://svelte.dev/docs/svelte/compiler-warnings
Supports
- Compiler diagnostics for component correctness and accessibility
- https://svelte.dev/docs/svelte/typescript
Supports
- TypeScript in component script blocks
- https://svelte.dev/docs/svelte/testing
Supports
- Component testing environments and supported test tools
- https://svelte.dev/docs/svelte/svelte-5-migration-guide
Supports
- Runes, snippets, event properties, and function-based components in Svelte 5
- Legacy syntax compatibility and migration paths
- https://svelte.dev/docs/kit/introduction
Supports
- SvelteKit as an application framework using Svelte
- Routing, rendering, data loading, and deployment concerns
- https://svelte.dev/tutorial/svelte/welcome-to-svelte
Supports
- Executable learning path through components and reactivity
- Reference-link rationale
- https://github.com/sindresorhus/awesome
Supports
- Discovery of the Svelte awesome list
- https://github.com/TheComputerM/awesome-svelte
Supports
- Discovery of shadcn-svelte, Melt UI, Superforms, and Svelte Testing Library
- Ecosystem categories for user-interface libraries, forms, and testing
- https://www.shadcn-svelte.com/docs
Supports
- Editable component-code distribution
- Composition, theming, installation, and shared interfaces
- Awesome Links rationale
- https://www.melt-ui.com/docs/introduction
Supports
- Headless component builders
- Accessibility attributes, focus behavior, keyboard interaction, and styling control
- Awesome Links rationale
- https://superforms.rocks/get-started
Supports
- Validation schemas, server load data, form actions, and bound client form state
- Awesome Links rationale
- https://testing-library.com/docs/svelte-testing-library/intro/
Supports
- Svelte component rendering and DOM-oriented testing
- Awesome Links rationale
- https://react.dev/learn
Supports
- React as a component library using JSX, props, state, and rendering
- Landscape comparison with Svelte compilation and templates
- https://vuejs.org/guide/introduction.html
Supports
- Vue single-file components, templates, and reactivity
- Landscape comparison with Svelte runes and bindings
- https://angular.dev/overview
Supports
- Angular as a full web framework with integrated application capabilities
- Landscape comparison with the Svelte and SvelteKit boundary
- https://docs.solidjs.com/quick-start
Supports
- Solid fine-grained reactivity and JSX component model
- Landscape comparison with Svelte compilation and runes
- https://qwik.dev/docs/concepts/resumable/
Supports
- Qwik resumability and server-to-browser interaction model
- Landscape comparison with Svelte hydration and effects
- https://svelte.dev/blog/frameworks-without-the-framework
Supports
- Svelte 1.0 date and compilation approach
- https://svelte.dev/blog/version-2
Supports
- Svelte 2 release date, template changes, lifecycle changes, and modern output
- https://svelte.dev/blog/svelte-3-rethinking-reactivity
Supports
- Svelte 3 release date, assignment-based reactivity, and svelte.dev move
- https://svelte.dev/blog/svelte-and-typescript
Supports
- Official TypeScript support date and consolidated language tooling
- https://svelte.dev/blog/whats-the-deal-with-sveltekit
Supports
- SvelteKit announcement date and succession of Sapper
- Intended routing, rendering, and adapter responsibilities
- https://svelte.dev/blog/sveltekit-beta
Supports
- SvelteKit public beta date, Vite adoption, and adapter model
- https://svelte.dev/blog/announcing-sveltekit-1.0
Supports
- SvelteKit 1.0 date and recommended application-framework status
- https://svelte.dev/blog/svelte-4
Supports
- Svelte 4 date, dependency baselines, package changes, and migration behavior
- https://svelte.dev/blog/runes
Supports
- Runes preview date and reactive design goals
- https://svelte.dev/blog/svelte-5-is-alive
Supports
- Svelte 5 date and stable runes, snippets, event, and component APIs
- https://github.com/sveltejs/svelte/discussions/14131
Supports
- Practitioner experience of Svelte 5 migration and client-only effect behavior
- The risk of deriving server-rendered output through a browser-only effect
