All frameworks
SvelteKitSvelteKit

Use NBForms with SvelteKit

SvelteKit's server-side capabilities make it ideal for form processing, but NBForms takes the work off your hands entirely. Get email alerts, spam filtering, and a full submissions dashboard without writing a +page.server.ts action.

Official SvelteKit docs
SvelteKit
<script>
  let status = 'idle'

  async function submit(e) {
    status = 'sending'
    const res = await fetch('https://api.nbforms.com', {
      method: 'POST',
      body: new FormData(e.target),
    })
    status = res.ok ? 'success' : 'error'
  }
</script>

{#if status === 'success'}
  <p>Thanks — we'll be in touch!</p>
{:else}
  <form on:submit|preventDefault={submit}>
    <input type="hidden" name="_token" value="YOUR_TOKEN" />
    <label>Name</label>
    <input type="text" name="name" required />
    <label>Email</label>
    <input type="email" name="email" required />
    <label>Message</label>
    <textarea name="message" required></textarea>
    <button type="submit" disabled={status === 'sending'}>
      {status === 'sending' ? 'Sending…' : 'Send'}
    </button>
  </form>
{/if}

Why NBForms?

  • Works with SvelteKit's client-side fetch pattern
  • No +page.server.ts action functions required
  • Handles loading, success, and error states reactively
  • Compatible with SvelteKit form actions if preferred

Add to your SvelteKit app in minutes

Free tier included. No credit card. No backend setup — just copy the snippet above and go.

Get started free