DEV Community

Cover image for Svelte Shadcn Forms, Superforms, Formsnap, zod
Florian Klenk
Florian Klenk

Posted on

Svelte Shadcn Forms, Superforms, Formsnap, zod

I want to start with a simple form. svelte Shadcn has a whole lineup of tools which suppose to work together seamlessly.
After copying the example from the svelte-shadcn page the form didn't work at first. Mainly my fault. The filenames were not setup properly.

Superforms, Formsnap, zod

svelte-shadcn is using formsnap which is using superforms for handling the forms.
zod is being used for validation.

Gotcha: +page.server.ts vs +page.ts

There seems to be a difference between those files. I think +page.ts is more SPA and +page.server.ts supports more doing in the backend e.g. backend rendering.
Found this example in superforms docs.

Top comments (0)