Form

A submission wrapper that distributes validation state to its fields.

The Form Component

Keep it short and readable.

Basic Usage

Code Snippet

<script lang="ts">		import { Button, Field, Form, Input } from '$lib/components'; 		let name = $state('');	</script> 	<Form class="grid gap-4">		<Field label="Project name" name="name">			<Input bind:value={name} placeholder="Spring launch" />		</Field> 		<Button type="submit">Create project</Button>	</Form>

Examples

Validation Errors

Pass form errors once and let each field read the message by name.

Use a work email before inviting teammates.