This content originally appeared on DEV Community and was authored by Florian Klenk
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.
This content originally appeared on DEV Community and was authored by Florian Klenk

Florian Klenk | Sciencx (2025-02-24T20:55:15+00:00) Svelte Shadcn Forms, Superforms, Formsnap, zod. Retrieved from https://www.scien.cx/2025/02/24/svelte-shadcn-forms-superforms-formsnap-zod/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.