PortForm
All templates

React contact form

A real React component: controlled fields with useState, a submit handler that posts FormData to the endpoint with fetch, and idle, sending, sent and error states. Keeping the <form action> means it still submits if the JavaScript never runs. In a Next.js or Vite app you would drop the three CDN scripts and paste the ContactForm component into a file; here it runs standalone so the preview is the paste. See the docs for the Server Action version.

React · HTML · CSS

Replace YOUR_ACCESS_KEY with the access key from your dashboard. Create one free. The endpoint and the honeypot are already in place.

Useful for

The part behind every one of these is a form backend. This template posts to a PortForm form endpoint, which stores each submission and sends it to your email; the docs cover the fields and responses.

Your form works in about a minute.

We use optional analytics cookies to understand how the site is used. Necessary cookies for signing in and checkout always load. See our privacy policy.