Svelte vs SvelteKit: the difference and when to use each
Svelte builds user interfaces. SvelteKit is the application framework built around Svelte: it adds routing, data loading, server endpoints, rendering choices and deployment adapters. You use Svelte components inside a SvelteKit application, so this is a choice about how much application infrastructure you need, not two competing component frameworks.
For a new multi-page Svelte application, SvelteKit is usually the starting point I would consider. For a widget inside an existing site or a reusable component library, Svelte can be enough. The official SvelteKit introduction makes the same distinction between the component layer and the application layer.
What Svelte handles
A .svelte component combines markup, JavaScript or TypeScript, and styles. The compiler transforms that component into code for its target environment. It supports reactive state, component composition and event handling. Calling Svelte “a programming language” misses its practical role as a UI framework; calling it “zero JavaScript” is also wrong.
This Svelte 5 component works inside a SvelteKit page or another Svelte setup:
<script>
let count = $state(0);
</script>
<button onclick={() => count += 1}>
Count: {count}
</button>$state declares reactive state. onclick attaches a click handler. The component does not decide the page URL, authenticate a user or choose a deployment platform. Those are separate concerns. See the Svelte overview and $state reference for the component model.
Older tutorials use reactive let declarations, $: and on:click. Those are legacy syntax supported by Svelte 5; they are not the syntax used in this example. An existing app does not need every component rewritten just to adopt Svelte 5. Follow the migration guide when changing a real codebase.
What SvelteKit adds
SvelteKit maps files in src/routes to URLs. A +page.svelte file defines a page; a +layout.svelte file shares UI across routes. Server-only load functions can read a database or private API and return the data the page needs. +server.ts files define HTTP endpoints.
For example, src/routes/projects/+page.svelte becomes /projects. A sibling +page.server.ts can supply its data:
// src/routes/projects/+page.server.ts
const load = () => ({
projects: [{ id: 'demo', name: 'Example project' }]
});
export { load };<!-- src/routes/projects/+page.svelte -->
<script>
let { data } = $props();
</script>
<h1>Projects</h1>
<ul>
{#each data.projects as project (project.id)}
<li>{project.name}</li>
{/each}
</ul>This deliberately uses fixed demo data. It shows the boundary between server loading and rendering, not a complete authenticated application. Data returned by load is sent to the page, so do not return secrets even when the function itself runs only on the server. Read the routing, load and server-only modules documentation before replacing the demo with private data.
The snippets were compiled with Svelte 5.55.0; the page/load pattern was checked against SvelteKit 2.55.0. These are the verification versions for this example, not a claim that they are the latest releases.
Choose by the job, not by the name
Embedded calculator in a WordPress page: use a Svelte component if the host site already owns navigation and rendering. You do not need to introduce a second application router for one widget.
Reusable component library: use Svelte for the components. You can use SvelteKit for a documentation or demo site without making the library itself a SvelteKit app.
Marketing site or blog with multiple URLs: SvelteKit provides routing and can prerender suitable pages for static hosting.
Account-based dashboard: SvelteKit provides server-side data loading and endpoints as well as UI routing. Authorization and database design remain your responsibility.
App with an existing backend: SvelteKit can call that backend. Adopting it does not require moving all backend logic into the frontend repository.
Browser-only internal tool: SvelteKit can run as a single-page app, or you can assemble a Svelte app with another router. Compare the routing and deployment work you would need to own in each case.
The important question is whether you already have good answers for navigation, data loading and deployment. If you do, integrating a component might be enough. If you do not, a bare Svelte setup leaves those choices to you.
SvelteKit does not require a server for every page
Server-side rendering produces HTML when a request arrives. Prerendering produces HTML during the build. Client-side rendering builds the interface in the browser. SvelteKit supports these approaches through page options and adapters; a project can make different choices for different routes.
By default, SvelteKit renders a page on the server and hydrates it in the browser. A static page can be prerendered, and pages without client interaction can disable client-side rendering. Disabling SSR is not the same thing as generating static HTML. The page-options documentation explains the distinctions and constraints.
A static deployment cannot execute server-only operations at request time. If a page needs fresh private data or a server-side mutation, provide a compatible server runtime or a separate backend. Pick an adapter for the environment you actually intend to deploy to.
What about forms and remote functions?
SvelteKit form actions support server-handled forms and progressive enhancement. Remote functions offer another way to call server code from the application, including validated forms. Their availability and configuration depend on your SvelteKit version; check the remote-functions documentation before copying an example from a different release.
Neither approach changes the basic relationship: Svelte describes the interface, while SvelteKit coordinates the application and server behavior. For a complete stable form-action example, see form validation with Zod. For shareable filters and pagination, see state in the URL.
What should you learn first?
Learn enough HTML, CSS and JavaScript to understand a component, then build a small Svelte interface. Add SvelteKit when you need pages, data loading or server behavior. You can learn those layers together; you do not need to finish an entire Svelte syllabus before creating a route.
If you are making this decision for an existing product, list the routes, private operations and deployment constraints first. Discuss an architecture question in a one-hour session if you want a second opinion on that plan. The session costs $149.