Headless React helpers for form backends
Bring your own markup and styling. Heapform handles submission, validation errors, file uploads, and success state for React and Next.js apps.
Quick Start
Add the React SDK with your preferred package manager and start building with your own components.
npm install @heapform/reactIntegrate your project seamlessly
Connect any React form to Heapform while keeping complete control of your components, validation, and styling.
Get startedimport { useHeapform } from "@heapform/react";
export function ContactForm() {
const [, submit] = useHeapform("contact");
return <form onSubmit={submit}>
<input name="email" type="email" required />
<button>Send</button>
</form>;
}“We integrated Heapform's React SDK into our SaaS and shipped reliable form handling without compromising our product's UI.”

B2B SaaS
Industrial Digitalization
Frequently asked questions
Common questions about using Heapform with React and Next.js.
A small, headless React package for submitting forms to Heapform. The useHeapform hook handles submitting, success, and error state, and HeapformValidationError renders field and form errors returned by Heapform. You bring your own markup and styles.
React 18.3 and later, including React 19.
Yes. Import submitHeapformAction from @heapform/react/next inside your own Server Action and wire it to useActionState. The Next.js helpers live behind an optional subpath export, so the main package stays framework-neutral.
Yes. Use the useSubmit hook when another library owns validation state. Its onError callback gives you Heapform's field and form errors so you can pass them to setError.
When a submission fails a rule you configured in the dashboard, Heapform returns a 422 response. The SDK turns it into a HeapformSubmissionError with getFieldErrors, getAllFieldErrors, and getFormErrors helpers, and HeapformValidationError can render them next to each field.
No. Any React form can post to a Heapform endpoint with fetch. The SDK saves you from writing submission state, error parsing, and reset logic yourself.
Yes. The SDK works with every Heapform plan, including the free Hobby plan.
See plansHassle-free forms for your website.
Create a form endpoint, install Heapform SDK, and ship your own UI in minutes.