Add a contact form to your React app in 2 minutes. Backend submission included.
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>
);
}Built with react-hook-form. Instant validation feedback.
Get notified instantly when someone submits your form.
Built-in honeypot and rate limiting. Keep spam out.
npm install @formflow.sh/reactSign up at formflow.sh/api-keys (50 submissions/month free)
Copy the example code above. Replace the API key. Done!
shadcn/ui
Material-UI
Chakra UI
Native HTML
Use your existing components. No proprietary UI required.
No! FormFlow provides the backend. No API routes, no serverless functions, no backend code required.
Data is stored securely in your FormFlow dashboard. You can view submissions, export to CSV, and set up email notifications.
Yes! Add any fields you want. The hook accepts any form data.
Yes! Free tier includes 50 submissions/month. No credit card required to start.