Beginner4 min readUpdated Mar 27, 2026

How to Add a Contact Form to SvelteKit (No Backend Required)

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.

By Vaibhav Jain·Published March 27, 2026

Prerequisites

  • SvelteKit project
  • FormsList account (free)
1

Create a FormsList endpoint

Sign up at formslist.com and create a form.

2

Build the form component

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}
3

Add to your route

Use the component in any +page.svelte file.

4

Deploy

Deploy to Vercel or Netlify and test.

Frequently Asked Questions

Ready to collect form submissions?

Set up your form backend in under a minute. No server required, no complex configuration — just a simple endpoint for your forms.