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.

Feb 24, 2025 - 22:22
 0
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.