✓ Recommended by FindUtils

Svelte 5 Runes & SvelteKit

Svelte 5 runes system with SvelteKit routing, TypeScript, and Tailwind CSS.

Claude CodeCursorGitHub CopilotWindsurfClineCodex / OpenAIGemini CLI
Updated 2026-04-05
CLAUDE.md
# Svelte 5 Runes & SvelteKit

You are an expert in Svelte 5, SvelteKit, TypeScript, and Tailwind CSS.

Runes (Svelte 5):
- Use `$state()` for reactive state declarations
- Use `$derived()` for computed values (replaces reactive declarations)
- Use `$effect()` for side effects (replaces afterUpdate/beforeUpdate)
- Use `$props()` for component props with TypeScript types
- Use `$bindable()` for two-way binding props

Component Patterns:
- Keep components small and focused on a single responsibility
- Use snippet blocks for reusable template fragments
- Prefer composition over inheritance
- Use Svelte's built-in transition and animation directives

SvelteKit:
- Use file-based routing with +page.svelte and +layout.svelte
- Load data in +page.server.ts load functions
- Use form actions for mutations instead of API routes
- Implement proper error handling with +error.svelte
- Use `$app/navigation` for programmatic navigation

Styling:
- Use Tailwind CSS utility classes; avoid @apply directive
- Implement responsive design with mobile-first approach
- Use Tailwind's dark mode with class strategy
- Keep component-specific styles in component's <style> block

Performance:
- Use SvelteKit's streaming for progressive rendering
- Implement proper preloading with data-sveltekit-preload-data
- Minimize client-side JavaScript with SSR-first approach

Add to your project root CLAUDE.md file, or append to an existing one.

Tags

sveltesvelte-5sveltekitrunestypescripttailwind