Next.js forms

Send from a Next.js client form directly to Formward when you do not need a custom server action. Browse 46 templates that generate clean Next.js code pointing to your Formward endpoint.

Implementation notes

  1. Add the generated client component
  2. Replace the endpoint placeholder
  3. Keep secrets out of the browser; the form ID is intentionally public

A working Next.js contact form

This server-rendered example is generated specifically for Next.js. Replace the endpoint placeholder with your public Formward form ID; it is not a secret.

Best for

Next.js marketing sites where a public form endpoint is simpler than a server action and database integration.

Watch for

Use a client component only for interactive state, never expose secrets, and keep the public form identifier configurable.

"use client";

import { useState } from "react";

export function SimpleContactForm() {
  const [sent, setSent] = useState(false);

  async function onSubmit(e: React.FormEvent<HTMLFormElement>) {
    e.preventDefault();
    const form = e.currentTarget;
    const res = await fetch("https://forms.formward.eu/f/your-form-id", {
      method: "POST",
      headers: { Accept: "application/json" },
      body: new FormData(form),
    });
    if (res.ok) {
      setSent(true);
      form.reset();
    }
  }

  if (sent) return <p>Thanks! Your message has been sent.</p>;

  return (
    <form onSubmit={onSubmit}>
      <label htmlFor="name">Name</label>
      <input type="text" name="name" id="name" required />
      <label htmlFor="email">Email</label>
      <input type="email" name="email" id="email" required />
      <label htmlFor="message">Message</label>
      <textarea name="message" id="message" required />
      <input
        type="text"
        name="_gotcha"
        tabIndex={-1}
        autoComplete="off"
        style={{ position: "absolute", left: "-9999px" }}
        aria-hidden="true"
      />
      <button type="submit">Send</button>
    </form>
  );
}

Application forms

6

Contact forms

6

Donation forms

3

Feedback forms

9

Order forms

5

Registration forms

5

Request forms

9

Signup forms

3
Next.js form templates, EU-hosted backend | Formward