Quickstart
You need Node 22 or later, a project on React 18.2 or later (Next.js, React Router in Framework mode, Astro, or React on its own), and a free Seaforms account at app.seaforms.io.
-
Add your site in the app. Go to Settings, then Sites. Under A site built with code, choose Add it, give it a name and its address, such as
https://northwind.co, and choose Add the site. -
Build a form and publish it. In Forms, choose New form. Start from a template, a description or a blank form, then choose Publish. Your code only ever sees published forms.
-
Install the package in your project.
-
Sign in and pull your forms. From your project’s folder:
Terminal window npx seaforms loginnpx seaforms pullTerminal window pnpm dlx seaforms loginpnpm dlx seaforms pullTerminal window yarn dlx seaforms loginyarn dlx seaforms pullTerminal window bunx seaforms loginbunx seaforms pullloginopens Seaforms in your browser to approve it.pullsaves each published form of the site insrc/forms(orformswhen there’s nosrc), with its types beside it:Terminal window $ npx seaforms pullNorthwind's forms, into src/forms:✔ contact revision 3, savedRebuild and deploy your site to put the change on its pages.The first time, it asks which site this project is (or picks your only one) and saves the answer in
seaforms.json. Commitseaforms.jsonand the form files. -
Show the form on a page.
app/contact/page.tsx import { Form } from "@seaforms/react";import contact from "@/forms/contact.seaforms.json";export default function ContactPage() {return (<main><h1>Get in touch</h1><Form schema={contact} /></main>);}Formis a client component, so a server page can use it as it is. Next.js renders it into the page’s HTML.In Framework mode. A new project has no
srcfolder, sopullsaves toforms:app/routes/contact.tsx import { Form } from "@seaforms/react";import contact from "../../forms/contact.seaforms.json";export default function ContactPage() {return (<main><h1>Get in touch</h1><Form schema={contact} /></main>);}React Router renders the form into the page’s HTML, on each visit or at build, and it wakes once its script loads.
Add Astro’s React integration if your project doesn’t have it:
Terminal window npx astro add reactsrc/pages/contact.astro ---import { Form } from "@seaforms/react";import contact from "../forms/contact.seaforms.json";---<h1>Get in touch</h1><Form schema={contact} client:load />client:loaddraws the form in the HTML and wakes it as the page loads. See Astro forclient:visibleand pages with no script at all.src/Contact.tsx import { Form } from "@seaforms/react";import contact from "./forms/contact.seaforms.json";export function Contact() {return <Form schema={contact} />;}Render it on the server where you can, so the form is in the page’s HTML before JavaScript loads. A page drawn only in the browser still works, but shows nothing until its script runs.
-
Add your site’s addresses. In the app, go to Settings, then Site details, and add every address the site is served from under Addresses, such as
https://northwind.coandhttps://www.northwind.co.A submission from an address that isn’t on the list is still kept, but as spam, so a copied form can’t fill your inbox.
-
Try it on your computer. Make a dev token under Dev tokens in Site details, and pass it while you work:
Your page <Form schema={contact} testToken="sfd_…" />On
localhost, answers sent with it are tests: kept apart from real ones and never counted against your plan. See Try it on your computer.
The file you pulled
Section titled “The file you pulled”src/forms/contact.seaforms.json holds the form’s questions, steps and logic. You never edit it: change the form in the app, publish, and pull again.
{ "schemaVersion": 1, "id": "frm_7f3kq2m4xa", "revision": 3, "locale": "en-AU", "timezone": "Australia/Adelaide", "presentation": { "mode": "steps", "progress": { "bar": false, "time": true }, "labels": { "next": "Continue", "back": "Back", "submit": "Send message" }, "estimatedSeconds": 60, "requiredMarker": "optional-label", "badge": false }, "steps": [ { "id": "get-in-touch", "title": "Get in touch", "blocks": [ { "kind": "field", "key": "name", "label": "Name", "placeholder": "Maya Chen", "required": true, "autocomplete": "name", "type": "text" }, { "kind": "field", "key": "email", "label": "Email", "placeholder": "maya@northwind.co", "required": true, "autocomplete": "email", "type": "email" }, { "kind": "field", "key": "topic", "label": "What’s it about?", "required": true, "type": "choice", "display": "chips", "options": [ { "value": "sales", "label": "Sales" }, { "value": "support", "label": "Support" }, { "value": "press", "label": "Press" }, { "value": "something-else", "label": "Something else" } ] }, { "kind": "field", "key": "message", "label": "Message", "placeholder": "How can we help?", "required": true, "type": "textarea" } ] } ], "endings": [ { "id": "thanks", "title": "Thanks, {name}.", "body": "Your message is with the right person. We usually reply the same day." } ], "features": [], "initial": { "hidden": [], "alwaysRequired": [ "name", "email", "topic", "message" ] }, "hash": "3096824560e56c78"}- Next.js, React Router or Astro: fetch the form while your site builds instead, so a client’s publish needs no pull.
- Styling: your own classes, or our finished look.
- Webhooks: each submission at your own endpoint.
ChatGPT is a trademark of OpenAI, and Claude and Claude Code are trademarks of Anthropic. Other product names and logos belong to their owners. None of them makes or endorses Seaforms. Trademarks