Library / SDK
ciscoheat/sveltekit-superforms avatar
ciscoheat/sveltekit-superforms

sveltekit-superforms: typed form handling for SvelteKit, with the validators you already use

Making SvelteKit forms a pleasure to use!

2,783 stars107 forksTypeScriptMIT

At a glance

What is it?
Superforms is an MIT-licensed TypeScript library that merges SvelteKit's PageData and ActionData, coerces FormData into typed values, and validates with Zod, Valibot, ArkType, Joi and others. It is for teams already committed to SvelteKit; it is not a framework-independent form library.
Who is it for?
Adopt sveltekit-superforms if your app is SvelteKit and you already keep a schema in Zod, Valibot, ArkType, Joi, TypeBox, Yup, VineJS, Superstruct, class-validator, Effect or JSON Schema; the library is the glue between that schema and SvelteKit's action pipeline, and it is MIT licensed so forking is possible if the maintainer stops.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 6 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 10, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The problem: SvelteKit gives you two data sources and no bridge

In SvelteKit, a form is a native HTML form posting to a server action. The load function returns PageData; the action returns ActionData; the component has to combine them, decide which one wins, and keep the merged object typed. Superforms exists to remove that merge. The README states it does "Seamless merging of PageData and ActionData - Forget about how to combine them, just focus on your form data, always strongly typed." That is the whole pitch, and it is narrower than the feature list makes it sound.

The second problem is FormData. Browsers send strings, so a number field arrives as "42", a checkbox as "on", a repeated field as an array of strings, and a file as a File object. Superforms, per the README, "Automatically coerces FormData into correct types, including arrays and files." For structures FormData cannot express, the README points to nested data, described as posting "nested data structures like a RPC call", which sidesteps the flat key-value model entirely.

The audience is therefore specific: a SvelteKit developer who has already chosen a validation library and wants the schema to be the single source of truth on both sides of the wire. If you have not chosen SvelteKit, nothing here applies to you.

How Superforms wires a schema to a SvelteKit action

The mechanism is a validation step that runs twice, once on the server inside the action and once in the browser. The README lists "Server- and client-side validation with your favorite validation libraries" and names ArkType, class-validator, Effect, Joi, Superstruct, TypeBox, Valibot, VineJS, Yup and Zod, plus JSON Schema used directly. The schema is the input; the library adapts it.

The central function is superValidate, which appears in the search data as "Superforms supervalidate". It takes the incoming data and the schema, validates, and returns an object holding the data, the validation result, and metadata the component needs. The component then calls superForm with that object and a set of options. The README points to "a huge list of options" in the API reference at superforms.rocks/api, which is where the real surface area lives.

Two details matter for architecture. First, the README claims "No JavaScript required as default, but full support for progressive enhancement", so the form works as a plain HTML post before hydration and upgrades afterwards. Second, the README states it "Works both on the server and with single-page applications (SPA)", which matters if you are using SvelteKit as a static or client-rendered shell. The library also exposes events: the README says you can "Hook into a number of events for full control over the validation data and the ActionResult, with a possibility to cancel the update at every step." That cancel hook is the escape hatch when the default flow does not fit.

Installing sveltekit-superforms and validating one field

The README does not print install commands. It says to "Follow the Get started tutorial on the website", at https://superforms.rocks/get-started, and links the npm package at https://www.npmjs.com/package/sveltekit-superforms. The package name in package.json is sveltekit-superforms. The repository's own build and publish scripts are driven by pnpm, as seen in package.json and pnpm-lock.yaml, so that is the package manager its maintainer uses:

bash
pnpm add sveltekit-superforms

You also need a validator. The README lists Zod among the supported libraries, and the search data includes "sveltekit superforms zod" and "sveltekit superforms zod 4", so a Zod schema is the conventional starting point. Zod is listed in the repository's package.json keywords alongside arktype, joi, typebox, valibot and yup:

bash
pnpm add zod

The README names superValidate as the entry point and describes generating "default form values from many validation schemas", so an empty post still yields a populated, typed object. The README does not print the call signature; it defers to the API page at https://superforms.rocks/api and the Get started tutorial for the exact import paths and arguments. Check those two pages for the version you install, because the adapter import subpath is the part most likely to differ between the v2 line and the v3.0.0-next.0 prerelease. Once the form object exists, superForm consumes it in the component and returns the form store plus helpers. The README notes "Realtime client-side validation for the best possible UX" and "Auto-centering and focusing on invalid form fields", so an invalid email should scroll into view and receive focus without extra code.

Where Superforms stops being the right tool

The library is bound to SvelteKit. Every mechanism described in the README depends on PageData, ActionData, server actions and the load function. If you are building with React, Vue, Solid or Svelte without SvelteKit, there is no partial adoption path here; the merging feature that justifies the dependency does not exist outside that framework. The search question "Is Svelte the same as SvelteKit?" is a fair signal that this boundary confuses people. It is not the same, and this package needs the latter.

The second constraint is the release line. The most recent release listed is v3.0.0-next.0, published 2026-08-27, which is a prerelease by its own version string. The last stable release is v2.30.2, published 2026-07-04. If your policy forbids prerelease dependencies, you are on v2.x and should expect the v3 line to move underneath you. The README does not document a migration path between the two, and the README does not document rollback either.

A third limitation is the FormData model itself. Coercion is convenient until it is wrong: a field that should stay a string but looks numeric will be converted, and the README does not describe an opt-out per field. The README offers "Proxy objects for handling data conversions to string and back again", which is the documented workaround, but it adds a layer you have to maintain.

Finally, the README's support model is worth reading before you depend on it. It states that support is free "in non-profit circumstances" and that commercial support requires a donation "proportional to the current profit of the project or the company you work for". That is an unusual arrangement for an MIT package, and it means the free channel is a Discord server, not an SLA.

Superforms against Formsnap and hand-rolled SvelteKit actions

Formsnap appears in the related searches, so it is the comparison people actually make. The difference is where the abstraction sits. Superforms owns the data layer: it validates, coerces, merges load and action results, and hands your component a typed object. Formsnap is a component-level layer for building accessible form markup on top of a schema. One is about what the form holds, the other about how it renders. They are not substitutes, and picking one does not answer the question the other asks.

The other alternative is doing it yourself: call your validator inside the action, return fail(400, { errors }), and merge that with load data in the component. That works, and for a single small form it is less machinery. It stops working when you have several forms on one page, which the README addresses with "Handles multiple forms on the same page", or when you want client-side validation without duplicating rules, or when you want tainted-form detection so a user does not lose typed input by navigating away. The README lists "Tainted form detection" and "snapshots" for exactly that case. Each of those is a thing you would otherwise write and test yourself.

The honest framing: Superforms is a bundle of form behaviours that most SvelteKit apps eventually need, packaged behind one API. If you need only one of them, write it yourself. If you need four, the dependency pays for itself.

Maintenance, upgrades and the MIT licence

The repository is not archived, and the last push was on 2026-08-27, which is recent. The release cadence visible in the release list is uneven: v2.30.1 on 2026-03-26, v2.30.2 on 2026-07-04, then v3.0.0-next.0 on 2026-08-27. That pattern suggests a maintainer preparing a major version rather than shipping incremental patches.

Upgrade cost is the part the README does not cover. There is a CHANGELOG.md in the repository root, and that is where a v2 to v3 migration would be documented, if it is documented at all. The README itself does not describe breaking changes, deprecations or a codemod. Before upgrading, read the changelog entry for the version you are moving to and check whether your adapter subpath changed, because the adapter import is the part most likely to move between majors.

The licence is MIT, stated in both the README metadata and package.json. In practical terms that permits commercial use, modification and redistribution with the copyright notice retained; it also means the project can be forked if maintenance stops. It does not give you a warranty, and it does not obligate the maintainer to fix anything. The funding configuration in package.json points at GitHub Sponsors, Ko-fi and PayPal, which is separate from the licence and does not change your rights. This is a description of the licence text, not legal advice; read LICENSE in the repository for the binding terms.

One more cost item: the package ships TypeScript types (the exports map points at ./dist/index.d.ts) and the build runs a check:adapters script via node types-exist.js. That script exists because adapter type exports are a real failure mode. If you write your own adapter, expect to keep it in step with the core package.

Editorial conclusion

Adopt sveltekit-superforms if your app is SvelteKit and you already keep a schema in Zod, Valibot, ArkType, Joi, TypeBox, Yup, VineJS, Superstruct, class-validator, Effect or JSON Schema; the library is the glue between that schema and SvelteKit's action pipeline, and it is MIT licensed so forking is possible if the maintainer stops. Do not adopt it for a React, Vue or plain Svelte SPA codebase, and do not adopt it if you need a stable release line right now, since the most recent release is v3.0.0-next.0, a prerelease published on 2026-08-27, while the last stable release is v2.30.2 from 2026-07-04. Before committing, verify three things against the version you install: that your validator's adapter is exported from the package, that the superForm options you need exist in the API page at superforms.rocks/api, and that your SvelteKit adapter is covered by the check:adapters script, because the README does not enumerate supported adapters.

Frequently asked questions

Is Svelte the same as SvelteKit?

No. They are different things, and this distinction decides whether sveltekit-superforms applies to you at all: the library depends on SvelteKit's PageData, ActionData, server actions and load functions, so a plain Svelte project without SvelteKit has no place to put it.

Is Svelte a good framework?

That is a general framework question and the repository does not answer it. The README only speaks to the form layer: it describes server- and client-side validation, progressive enhancement without JavaScript by default, and support for single-page applications.

How can I create and use forms in Svelte?

In a SvelteKit app, the README's route is to define a validation schema, call superValidate with it in a load function or action, and pass the result to superForm in the component. The README directs readers to the Get started tutorial at superforms.rocks/get-started rather than printing the steps itself.

What language does Svelte use?

The repository does not cover that. What it does state is that sveltekit-superforms is written in TypeScript, that its package exports map points at ./dist/index.d.ts, and that it ships types for the form data it returns.

Official sources

  1. ciscoheat/sveltekit-superforms on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/ciscoheat-sveltekit-superforms.svg)](https://hysenlabs.com/projects/ciscoheat-sveltekit-superforms)