A Form component for SvelteKit that enhances the native form element, preventing full page reloads on form submission if JavaScript is enabled.
npm install sveltekit-form
Simply replace any usage of <form>
with <Form>
<script lang="ts">
import { Form } from 'sveltekit-form';
</script>
<Form method="post" let:form>
<input name="username" />
<input type="password" name="password" />
<button disabled={form.transition.state !== 'idle'}> Login </button>
<button formaction="/forgot-password"> Forgot Password </button>
</Form>
This project is used in production at Aircast.