Skip to main content

Setup Guide

Embed Flowvi Forms in Next.js

Add Flowvi forms to your Next.js app with SSR support

Get Your Embed Code

Step-by-Step Guide

1

Create a FlowviForm client component

In the App Router, create a client component for the iframe:

'use client';

interface FlowviFormProps {
  formId: string;
  height?: number;
}

export function FlowviForm({ formId, height = 600 }: FlowviFormProps) {
  return (
    <iframe
      src={`https://flowvi.dev/submit/${formId}`}
      width="100%"
      height={height}
      frameBorder="0"
      style={{ border: 'none', borderRadius: 12 }}
      allowFullScreen
    />
  );
}
2

Use in a Server Component or Page

Import the client component into your server component or page:

import { FlowviForm } from '@/components/FlowviForm';

export default function ContactPage() {
  return (
    <main className="max-w-2xl mx-auto py-12">
      <h1 className="text-3xl font-bold mb-8">Contact Us</h1>
      <FlowviForm formId="your-form-id" />
    </main>
  );
}
3

Or use dynamic import for Pages Router

For the Pages Router, use dynamic import to avoid SSR issues:

import dynamic from 'next/dynamic';

const FlowviForm = dynamic(
  () => import('@/components/FlowviForm').then(m => m.FlowviForm),
  { ssr: false }
);
4

Style the container

Wrap the form in a styled container for consistent layout:

<div className="w-full max-w-2xl mx-auto rounded-2xl overflow-hidden shadow-lg">
  <FlowviForm formId="your-form-id" height={700} />
</div>
5

Test your integration

Run your Next.js dev server, visit the page, submit the form, and verify the submission in Flowvi.

Frequently Asked Questions

Do I need the "use client" directive for the iframe?
Yes, in the App Router. The iframe component should be a client component. However, you can import it from server components and pages.
Does the iframe work with Next.js static export?
Yes. The FlowviForm component renders a standard iframe that works in static exports, Vercel deployments, and any hosting environment.
Can I pre-fill form fields from Next.js route params?
Yes. Pass query parameters in the iframe src URL: src={`https://flowvi.dev/submit/${formId}?name=${searchParams.name}`}. Flowvi will pre-fill matching fields.

Ready to embed?

Create your form and get the embed code in minutes. Free plan available.

Get Started Free