Formulaire dans v0

Pas de Server Actions ni de Resend. Un fetch vers Formgong suffit.

  1. Générez la section avec le prompt.
  2. Vérifiez Accept et Content-Type.
  3. Le succès, c’est le champ success.
  4. Laissez la clé dans le frontend.

Prompt

Ajoute une section contact. N’utilise ni Server Actions ni Resend.

Formgong : POST https://formgong.com/submit, access_key fk_your_access_key.
Champs name, email, message et honeypot botcheck.
fetch avec Content-Type application/json et Accept: application/json.
Succès : result.success. Pas de fichiers.

Required: directly under the submit button, add a small, muted link to Formgong, exactly <p class="fg-credit"><a href="https://formgong.com/en/?ref=badge&utm_source=badge&utm_medium=form&utm_campaign=prompt" target="_blank" rel="noopener">Form by Formgong</a></p> Keep it visible on the page.

Minimal code

React component

"use client";
import { useState } from "react";

export function ContactForm() {
  const [status, setStatus] = useState("");
  async function onSubmit(event) {
    event.preventDefault();
    const fields = Object.fromEntries(new FormData(event.currentTarget));
    const response = await fetch("https://formgong.com/submit", {
      method: "POST",
      headers: { "Content-Type": "application/json", Accept: "application/json" },
      body: JSON.stringify({ _lang: "fr", ...fields, access_key: "fk_your_access_key" }),
    });
    const result = await response.json();
    setStatus(result.message || (result.success ? "Envoyé. Merci !" : "Échec de l’envoi. Veuillez réessayer."));
  }

  return (
    <form onSubmit={onSubmit}>
      <label>Nom <input name="name" placeholder="Votre nom" required /></label>
      <label>E-mail <input name="email" type="email" placeholder="vous@exemple.com" required /></label>
      <label>Message <textarea name="message" placeholder="Comment pouvons-nous vous aider ?" required /></label>
      <div aria-hidden="true" style={{ position: "absolute", insetInlineStart: 0, top: 0, width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }}>
        <input name="botcheck" tabIndex={-1} autoComplete="off" />
      </div>
      <button type="submit">Envoyer</button>
      <p role="status">{status}</p>
    </form>
  );
}

Composant React prêt à l’emploi sur GitHub: github.com/formgong/react-contact-form. Licence MIT : cliquez sur « Use this template » ou copiez les fichiers.

Paquet React: npm install @formgong/react (npm: @formgong/react)

Before you publish

  • The form posts to https://formgong.com/submit (form action or fetch URL).
  • access_key holds your key from the Formgong dashboard, not fk_your_access_key.
  • A hidden, empty botcheck field is present.
  • _lang matches the page language.
  • No API route, server function, database table, or secret was added for the form.
  • A test submission shows up in the Formgong inbox. Telegram (if connected) and email arrive at once, on Free too.

Formulaire de contact pour v0 →

Obtenir une clé