svelte-runes

Which rune? Props: $props() | Bindable: $bindable() | Computed: $derived() | Side effect: $effect() | State: $state()

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "svelte-runes" with this command: npx skills add spences10/svelte-skills-kit/spences10-svelte-skills-kit-svelte-runes

Svelte Runes

Quick Start

Which rune? Props: $props() | Bindable: $bindable() | Computed: $derived() | Side effect: $effect() | State: $state()

Key rules: Runes are top-level only. $derived can be overridden (use const for read-only). Don't mix Svelte 4/5 syntax. Objects/arrays are deeply reactive by default.

Example

<script> let count = $state(0); // Mutable state const doubled = $derived(count * 2); // Computed (const = read-only)

$effect(() => {
	console.log(`Count is ${count}`); // Side effect
});

</script>

<button onclick={() => count++}> {count} (doubled: {doubled}) </button>

Reference Files

  • reactivity-patterns.md - When to use each rune

  • migration-gotchas.md - Svelte 4→5 translation

  • component-api.md - $props, $bindable patterns

  • snippets-vs-slots.md - New snippet syntax

  • common-mistakes.md - Anti-patterns with fixes

For @attach and other template directives, see the svelte-template-directives skill.

Notes

  • Use onclick not on:click , {@render children()} in layouts

  • $derived can be reassigned (5.25+) - use const for read-only

  • Use createContext over setContext /getContext for type safety

  • Use $inspect.trace to debug reactivity issues

  • Last verified: 2026-03-12

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

sveltekit-structure

No summary provided by upstream source.

Repository SourceNeeds Review
General

sveltekit-remote-functions

No summary provided by upstream source.

Repository SourceNeeds Review
General

sveltekit-data-flow

No summary provided by upstream source.

Repository SourceNeeds Review
General

svelte-components

No summary provided by upstream source.

Repository SourceNeeds Review