Svelte and SvelteKit 5 · Runes (reactivity)

Derived values

$derived recalculates a value when the state it reads changes.

let count = $state(0);
let doubled = $derived(count * 2);

Official Svelte and SvelteKit 5 documentation

More runes (reactivity) commands

All runes (reactivity) commands · Svelte and SvelteKit 5 cheatsheet

Was this page helpful?