The framework that compiles itself away.
Svelte is a JavaScript framework created by Rich Harris in 2016 that takes a different approach from React or Vue: instead of shipping a runtime library that updates the page in the browser, Svelte is a compiler. You write components, and at build time Svelte turns them into small, plain JavaScript that surgically updates the exact DOM nodes that changed — no virtual DOM, no framework code shipped to the user.
The result is famously small bundle sizes and fast runtime performance, with a syntax many developers find closer to plain HTML/CSS/JS than any other component framework.
Reach for Svelte when performance and bundle size matter a lot — embedded widgets, marketing sites with interactive pieces, or apps where every kilobyte counts — or simply because you enjoy writing less boilerplate. The trade-off is ecosystem size: fewer third-party components, fewer Stack Overflow answers, and fewer job listings than React. If you're optimizing for employability or need the largest possible community while learning, React or Vue are safer bets.
.svelte
files are compiled to vanilla JS at build time; there's no
Svelte runtime shipped to the browser.
count = count + 1) and Svelte updates the DOM. No
useState or ref() wrapper needed.
.svelte file holds markup, script, and scoped
styles together.
<script>
let count = 0;
</script>
<button on:click={() => count++}>
Clicked {count} times
</button>
No hooks, no imports for reactivity. Assigning to
count is enough — the compiler figures out which DOM
node to update.
npx sv create my-app (the current SvelteKit CLI).
npm install and npm run dev, then
edit src/routes/+page.svelte and watch it update
live.
{'{'}#each{'}'} block to render
a list.