React Contact Form with Backend

Add a contact form to your React app in 2 minutes. Backend submission included.

Complete Contact Form Example

This code creates a fully functional contact form. Copy, paste, and you're done:

import { useFormFlow } from '@formflow.sh/react';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
import { Label } from '@/components/ui/label';
import { Textarea } from '@/components/ui/textarea';

export function ContactForm() {
  const { register, handleSubmit, formState } = useFormFlow({
    apiKey: process.env.NEXT_PUBLIC_FORMFLOW_API_KEY,
    onSuccess: () => alert('Message sent! We\'ll get back to you soon.'),
  });

  return (
    <form onSubmit={handleSubmit} className="space-y-4 max-w-md">
      <div>
        <Label htmlFor="email">Email *</Label>
        <Input
          {...register('email')}
          id="email"
          type="email"
          placeholder="you@example.com"
          required
        />
      </div>

      <div>
        <Label htmlFor="name">Name *</Label>
        <Input
          {...register('name')}
          id="name"
          placeholder="John Doe"
          required
        />
      </div>

      <div>
        <Label htmlFor="message">Message *</Label>
        <Textarea
          {...register('message')}
          id="message"
          placeholder="How can we help you?"
          required
        />
      </div>

      <Button type="submit" disabled={formState.isSubmitting}>
        {formState.isSubmitting ? 'Sending...' : 'Send Message'}
      </Button>
    </form>
  );
}

User-Friendly

Built with react-hook-form. Instant validation feedback.

Auto Email Notifications

Get notified instantly when someone submits your form.

Spam Protection

Built-in honeypot and rate limiting. Keep spam out.

What You Get

Frontend (React Hook)

  • ✓ Form state management
  • ✓ Real-time validation
  • ✓ Loading states
  • ✓ Error handling
  • ✓ Works with any UI library

Backend (Included)

  • ✓ Form submission API
  • ✓ Data storage
  • ✓ Email notifications
  • ✓ Spam protection
  • ✓ Rate limiting

Get Started in 3 Steps

1

Install Package

npm install @formflow.sh/react
2

Get Free API Key

Sign up at formflow.sh/api-keys (50 submissions/month free)

3

Add Form to Your App

Copy the example code above. Replace the API key. Done!

Works With Your UI Library

shadcn/ui

Material-UI

Chakra UI

Native HTML

Use your existing components. No proprietary UI required.

Frequently Asked Questions

Do I need a backend server?

No! FormFlow provides the backend. No API routes, no serverless functions, no backend code required.

What happens to the form data?

Data is stored securely in your FormFlow dashboard. You can view submissions, export to CSV, and set up email notifications.

Can I customize the form fields?

Yes! Add any fields you want. The hook accepts any form data.

Is it free?

Yes! Free tier includes 50 submissions/month. No credit card required to start.

Start collecting contact form submissions today

2-minute setup. No credit card required.

React Contact Form with Backend | FormFlow - 2 Minute Setup | FormFlow