Svelte

Compiler-based UI framework — no virtual DOM, components compile to vanilla JS for minimal bundle size and maximum performance.

JavaScript free Open Source web since 2016

Svelte shifts work from the browser to compile time — there’s no runtime framework overhead, just optimised vanilla JavaScript. Its reactive assignments and simple syntax make it approachable for beginners while its performance characteristics appeal to production teams building fast, lightweight UIs. Svelte 5 introduced Runes ($state, $derived, $effect) as a more explicit reactivity system that also works outside of .svelte files.

Quick start

npm create svelte@latest my-app
cd my-app && npm install && npm run dev
<!-- src/lib/Counter.svelte -->
<script>
  let count = $state(0)
  const doubled = $derived(count * 2)
</script>

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

<style>
  button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
</style>
<!-- Fetch data with onMount -->
<script>
  import { onMount } from 'svelte'

  let users = []

  onMount(async () => {
    const res = await fetch('/api/users')
    users = await res.json()
  })
</script>

{#each users as user (user.id)}
  <p>{user.name}</p>
{/each}

When to use

Svelte is the best choice when bundle size and runtime performance are priorities — marketing pages, interactive widgets embedded in larger sites, and performance-sensitive dashboards. Its simpler syntax lowers the barrier to entry compared to React or Vue. For a full-stack Svelte application with SSR and routing, use SvelteKit. The ecosystem is smaller than React’s, so factor in library availability for complex UI requirements.

// features

  • Compiler-based — components compile to optimised vanilla JS, no runtime overhead
  • No virtual DOM — direct DOM mutations for maximum performance
  • Reactive assignments — `count++` just works, no `useState` or `ref()` needed
  • Scoped CSS built into every component by default
  • Stores for shared state — `writable()`, `readable()`, `derived()`
  • Transitions and animations as first-class language features
  • Svelte 5 Runes — `$state`, `$derived`, `$effect` for fine-grained reactivity
  • Smallest bundle sizes of any major UI framework

// installation

npm npm create svelte@latest my-app
pnpm pnpm create svelte my-app

// commonly used libraries

Modern JavaScript date utility library — pure functions, immutable, tree-shakeable, and …

utility 2015 open source

Powerful async state management for server data — caching, background refetching, pagination, …

http 2019 open source

// tags

frontendcomponentscompilerperformancespaui
Something wrong? Edit this entry on GitHub.
✏ Edit on GitHub