Svelte
A frontend framework for building web interfaces out of reusable components. It compiles those components into code that updates the relevant parts of the page when data changes.
What is Svelte?
Svelte is a framework for building web interfaces. A component can be as small as a search box or as large as a whole page, and it can include other components. A .svelte file typically contains HTML-like markup, a script written in JavaScript or TypeScript, and optional CSS. Styles in the file's <style> block are scoped to the component by default, so a rule for a button doesn't automatically style buttons elsewhere on the page.
What the compiler does
During a build, the Svelte compiler transforms components into JavaScript. For the browser, it generates code that creates DOM nodes and updates them as reactive values change. If the number in a cart badge changes, the generated code can update the badge text without building and comparing two versions of a virtual DOM tree. That doesn't mean everything happens at build time: event handlers and the mechanisms that track reactive dependencies still run in the browser.
Svelte 5 uses a syntax called runes to describe reactivity. $state marks a value that can change and be tracked. $derived defines a value calculated from reactive inputs. $props exposes inputs passed to a component by its parent. Runes are recognized by the compiler; you don't import them as ordinary JavaScript functions.
Example: a quantity picker
<script>
let quantity = $state(1);
let total = $derived(quantity * 12);
</script>
<button onclick={() => quantity++}>Add one</button>
<p>{quantity} items · ${total}</p>
The click handler only changes quantity. Because total depends on it, the page shows both the new quantity and the new total. There is no second assignment to keep the values in sync, and the handler doesn't need to know which DOM nodes display them.
Svelte vs. SvelteKit
Svelte alone is enough to build an interactive widget or the UI for a client-rendered application. SvelteKit adds application-level features such as file-based routing, page data loading, and server-side rendering. If you want a product page to arrive as HTML and then become interactive in the browser, that is a rendering setup SvelteKit can provide, not something every Svelte component does on its own.
What comes up in interviews
You might be asked when to use $derived rather than $effect. Use $derived for a value you can calculate from existing state, such as a filtered list. Use $effect when a reactive change must do something outside that calculation, such as updating a chart through a third-party library. Also be ready to identify the syntax in an existing codebase: $: and export let are common in legacy-mode components, which Svelte 5 still supports.