Add a working contact form to SvelteKit using FormsList.
TL;DR
Add a contact form to SvelteKit by creating a Svelte component with bind:value and submitting to a FormsList endpoint. No +server.ts file needed — FormsList handles the backend, spam protection, and notifications.
Sign up at formslist.com and create a form.
Create a Svelte component with reactive state.
<script>
let name = $state('')
let email = $state('')
let message = $state('')
let submitted = $state(false)
async function handleSubmit(e) {
e.preventDefault()
const res = await fetch('https://formslist.com/f/YOUR_HASH', {
method: 'POST',
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
body: JSON.stringify({ name, email, message }),
})
if (res.ok) submitted = true
}
</script>
{#if submitted}
<p>Thanks! We'll be in touch.</p>
{:else}
<form onsubmit={handleSubmit}>
<input bind:value={name} placeholder="Name" required />
<input bind:value={email} type="email" placeholder="Email" required />
<textarea bind:value={message} placeholder="Message" required />
<button type="submit">Send</button>
</form>
{/if}Use the component in any +page.svelte file.
Deploy to Vercel or Netlify and test.
Build a fully functional contact form in React with hooks, validation, and email notifications. No backend server or API routes needed.
Learn moreAdd a fully functional contact form to any static site generator — Jekyll, Hugo, Eleventy, Astro, or plain HTML. No server-side code required.
Learn moreSet up your form backend in under a minute. No server required, no complex configuration — just a simple endpoint for your forms.