Basic Actions in Svelte
From the SvelteKit cheat sheet ยท Form Actions ยท verified Jul 2026
Basic Actions
Server-side form handling
javascript
// +page.server.js
export const actions = {
default: async ({ request }) => {
const data = await request.formData();
const email = data.get('email');
// Process form
return { success: true };
}
};
// +page.svelte
<form method="POST">
<input name="email" type="email" />
<button>Submit</button>
</form>๐ Progressive enhancement - works without JavaScript
๐ Server-side validation and processing
๐ช Direct cookie access for authentication
โก use:enhance for optimistic UI updates