Contact form for Next.js
A contact form for Next.js
@boosterpack/react-form. It handles the silent spam checks and the submit. No extra script tag.How to add it
Create the form, paste it into Next.js, click activate once.
Sign in to your dashboard, add a destination email, and copy the form ID.
Run npm i @boosterpack/react-form. That replaces the embed script.
Use <BoosterpackForm> or useBoosterpackForm in a Client Component.
App Router: add 'use client' at the top of the form file.
Open the live page, click Activate form, and confirm from your inbox.
Copy this
Copy your form ID from the dashboard, then drop this in.
<form method="POST" action="https://boosterpackforms.com/api/forms/<FORM_ID>/submit">
<input name="name" placeholder="Name" required />
<input name="email" type="email" placeholder="Email" required />
<textarea name="message" placeholder="Message" required></textarea>
<button type="submit">Send</button>
</form>Next.js is React, so you can skip the script and use the official package.
npm i @boosterpack/react-form'use client'
import { BoosterpackForm } from '@boosterpack/react-form'
export function ContactForm() {
return (
<BoosterpackForm formId='<FORM_ID>'>
{({ status, error }) => (
<>
<input name='name' placeholder='Name' required />
<input name='email' type='email' placeholder='Email' required />
<textarea name='message' placeholder='Message' required />
<button type='submit' disabled={status === 'sending'}>
{status === 'sending' ? 'Sending…' : 'Send'}
</button>
{status === 'success' && <p>Sent!</p>}
{status === 'error' && error && <p>{error}</p>}
</>
)}
</BoosterpackForm>
)
}TypeScript: the package ships types. Status, error, and the form ref are already typed.
One-time activation
Open the live page. Click Activate form. We email you so only you can turn the form on for that domain. Each inbox you add also confirms once. After that, it stays on.
What you get
Common questions
Do visitors have to solve a CAPTCHA?
Is there a free plan?
Can I send submissions to Slack or Discord too?
Does Boosterpack Forms store the messages?
Free plan. No credit card.