Contact form examples for 13 frameworks using StaticForms.dev, a form backend for static sites. Each example is a small app you can deploy to Vercel with one click. None of them need a backend.
📖 For step-by-step walkthroughs, read the StaticForms blog. Each example below links to its tutorial.
| Framework | Stack | Source | Guide | Deploy |
|---|---|---|---|---|
| Next.js | Next.js 16 + React 19 | apps/next-example |
Tutorial | |
| Nuxt | Nuxt 4 + Vue 3.5 | apps/nuxt-example |
Tutorial | |
| React | React 19 + Vite 8 | apps/react-example |
Tutorial | |
| Vue | Vue 3.5 + Vite 8 | apps/vue-example |
Tutorial | |
| SvelteKit | SvelteKit 3 + Svelte 5 | apps/sveltekit-example |
Tutorial | |
| Astro | Astro 7 | apps/astro-example |
Tutorial | |
| Angular | Angular 22 | apps/angular-example |
Tutorial | |
| React Router | React Router 8 (framework mode) + React 19 | apps/react-router-example |
Tutorial | |
| SolidStart | SolidStart 2 + Solid 1.9 | apps/solid-start-example |
Tutorial | |
| Qwik | Qwik 1.20 + Qwik City | apps/qwik-example |
Tutorial | |
| Gatsby | Gatsby 5 + React 19 | apps/gatsby-example |
Tutorial | |
| Eleventy | Eleventy 3 | apps/eleventy-example |
Tutorial | |
| HTML | Plain HTML + vanilla JavaScript | apps/html-example |
Tutorial |
Every example has the same form (name, email, message), the same loading/success/error states and the same styling. That makes it easy to compare how each framework handles the same task.
- Node.js 24 or later (see
.nvmrc) - pnpm 10 (
corepack enablepicks up the version pinned inpackage.json)
git clone https://github.com/static-forms/static-forms-examples.git
cd static-forms-examples
pnpm install- Create a free account and get your API key at staticforms.dev.
- Copy the example env file in the app you want to run and add your key:
cp apps/next-example/env.example apps/next-example/.env.localEach framework exposes environment variables to the browser differently:
| Framework | Variable | File |
|---|---|---|
| Next.js | NEXT_PUBLIC_STATICFORMS_API_KEY |
apps/next-example/.env.local |
| Nuxt | NUXT_PUBLIC_STATICFORMS_API_KEY |
apps/nuxt-example/.env |
| React | VITE_STATICFORMS_API_KEY |
apps/react-example/.env.local |
| Vue | VITE_STATICFORMS_API_KEY |
apps/vue-example/.env.local |
| SvelteKit | PUBLIC_STATICFORMS_API_KEY |
apps/sveltekit-example/.env |
| Astro | PUBLIC_STATICFORMS_API_KEY |
apps/astro-example/.env |
| Angular | NG_APP_STATICFORMS_API_KEY |
apps/angular-example/.env |
| React Router | VITE_STATICFORMS_API_KEY |
apps/react-router-example/.env |
| SolidStart | VITE_STATICFORMS_API_KEY |
apps/solid-start-example/.env |
| Qwik | PUBLIC_STATICFORMS_API_KEY |
apps/qwik-example/.env |
| Gatsby | GATSBY_STATICFORMS_API_KEY |
apps/gatsby-example/.env.development / .env.production |
| Eleventy | STATICFORMS_API_KEY |
apps/eleventy-example/.env |
| HTML | STATICFORMS_API_KEY |
apps/html-example/.env |
pnpm dev # every example at once
pnpm dev:next # Next.js on http://localhost:3000
pnpm dev:nuxt # Nuxt on http://localhost:3001
pnpm dev:react # React on http://localhost:3002
pnpm dev:vue # Vue on http://localhost:3003
pnpm dev:sveltekit # SvelteKit on http://localhost:3004
pnpm dev:astro # Astro on http://localhost:3005
pnpm dev:angular # Angular on http://localhost:3006
pnpm dev:react-router # React Router on http://localhost:3007
pnpm dev:solid-start # SolidStart on http://localhost:3008
pnpm dev:qwik # Qwik on http://localhost:3009
pnpm dev:gatsby # Gatsby on http://localhost:3010
pnpm dev:eleventy # Eleventy on http://localhost:3011
pnpm dev:html # HTML on http://localhost:3012pnpm build # builds every example with TurborepoUse the Deploy buttons in the table above. Each one:
- Copies this repository into your GitHub account
- Creates a Vercel project with the Root Directory set to that example's folder
- Asks for that example's API key environment variable
Each app has a vercel.json that installs only that app's dependencies (pnpm install --filter <app>...), so deploys stay fast even though this is a monorepo.
All examples send a JSON POST from the browser:
// POST https://api.staticforms.dev/submit
{
"apiKey": "YOUR_API_KEY",
"name": "Jane Doe",
"email": "jane@example.com",
"message": "Hello!",
"replyTo": "@", // reply-to = the sender's email
"subject": "New Contact Form Submission"
}Responses:
{ "success": true }
{ "success": false, "message": "Error description" }See the StaticForms documentation for spam protection (honeypot, reCAPTCHA, Turnstile, ALTCHA), file uploads, redirects, webhooks and integrations.
static-forms-examples/
├── apps/
│ ├── next-example # Next.js 16 + React 19
│ ├── nuxt-example # Nuxt 4 + Vue 3.5
│ ├── react-example # React 19 + Vite 8
│ ├── vue-example # Vue 3.5 + Vite 8
│ ├── sveltekit-example # SvelteKit 3 + Svelte 5
│ ├── astro-example # Astro 7
│ ├── angular-example # Angular 22
│ ├── react-router-example # React Router 8 (framework mode) + React 19
│ ├── solid-start-example # SolidStart 2 + Solid 1.9
│ ├── qwik-example # Qwik 1.20 + Qwik City
│ ├── gatsby-example # Gatsby 5 + React 19
│ ├── eleventy-example # Eleventy 3
│ ├── html-example # Plain HTML + vanilla JavaScript
├── turbo.json # Turborepo pipeline
├── pnpm-workspace.yaml # pnpm workspace
└── package.json
- Blog: tutorials and guides
- Getting started with Static Forms
- Adding contact forms to static sites
- Documentation
MIT