Useful library for working with forms in Svelte(kit) offering both validation on the client and server. It supports zod amongst many other validation libraries.
Basic example
Then creating the form in the client: (an example on a recent project of mine)
<form method="POST" action="?/myForm" use:enhanceNewBean>
Name: <input name="name" type="text" bind:value={$form.name} />
Brand:
<input name="brand" type="text" bind:value={$form.brand} />
<input name="weight" type="number" bind:value={$form.weight} />
<button>Submit</button>
</form>
Debugging
<SuperDebug data={$form}/>
is a helper component for debugging forms