Tutorial

Embed a Form on Your Website

Embedding a form on your website should take 30 seconds, not an afternoon. With CraftForm, you can add a form to any site — WordPress, Webflow, Next.js, React, Framer, Notion, Shopify, Ghost, Squarespace, or plain HTML — with a single snippet and zero coding.

This guide walks through every embed mode (inline, popup, slider, side tab), every supported host, and every tip we have learned from helping thousands of creators ship their first form.

Why teams choose CraftForm

  • Inline, popup, slider, and side tab embeds — your choice
  • One-line snippet works on every major hosting platform
  • Auto-resizing iframe adapts to your form height
  • Prefill fields from URL parameters for personalisation
  • Full theming — inherit your site's colours and fonts
  • Zero JavaScript bloat — our script is under 8kb gzipped

The four ways to embed a form

CraftForm supports four embed modes, each with a different use case:

  • Inline — the form sits directly in the flow of your page. Best for contact, feedback, and conversion-focused forms.
  • Popup — opens on click or after a delay, covers the page with a modal. Best for waitlists and lead magnets.
  • Slider — slides in from the edge. Less intrusive than a popup, good for newsletter signups.
  • Side tab — a persistent tab on the edge of the screen. Ideal for feedback widgets.

Each mode uses the same underlying embed snippet — only a single parameter changes. Switching modes after deploy is a one-line edit.

Embedding on WordPress

  1. In CraftForm, open your form and click Embed.
  2. Pick Inline or Popup and copy the snippet.
  3. In WordPress, edit the page you want to embed on.
  4. Add a Custom HTML block.
  5. Paste the snippet. Save and preview.

That is it. No plugin required, no shortcode to remember, no premium upgrade. The form resizes automatically to match its content and inherits your theme.

Embedding on Webflow, Framer, and Notion

Webflow: add an Embed component from the Add panel, paste the CraftForm snippet, publish. Works on the free plan of Webflow.

Framer: insert an Embed element, paste the snippet. CraftForm renders inside Framer's iframe wrapper without layout issues.

Notion: use a /embed block and paste the public form URL. Notion will render it in line with the rest of your page.

Ghost: use an HTML card. Squarespace: use a Code block. Shopify: paste into a Custom Liquid section.

Embedding in React, Next.js, and other code projects

For React and Next.js projects, CraftForm ships an official @craftform/react package. Install with npm and drop in the component:

import { CraftForm } from '@craftform/react'

export default function Contact() {
  return <CraftForm formId="your-form-id" mode="inline" />
}

The component is fully SSR-compatible, tree-shakable, and respects your app router boundaries. No hydration mismatches, no layout shift.

Prefer not to install a package? Use the vanilla embed — a single <script> tag and a <div> works in any framework.

Prefilling and personalising embedded forms

You can prefill any form field via URL parameters. This is powerful for personalisation — pass a user's name, email, or company from your CRM or marketing automation and the form arrives already populated.

Example: https://craftform.co/f/your-form?email=user@example.com&plan=pro

Prefill works with both inline and popup embeds. Hidden fields are also supported, which is useful for UTM tracking and attribution.

Styling and theming embedded forms

CraftForm embeds inherit your site's root CSS variables automatically. Fonts, colours, border radii — everything matches your brand without manual configuration. For pixel-perfect control, you can apply custom CSS in the form editor or via the theme prop in React.

The embed iframe is sandboxed for security but still gets access to CSS variables you define on the parent page, so dark mode, brand colours, and custom fonts all just work.

Performance and privacy

The CraftForm embed script is under 8kb gzipped. It loads asynchronously, does not block page rendering, and sets zero third-party cookies. Your Core Web Vitals stay clean — we have verified with Lighthouse that embedding a CraftForm has negligible impact on LCP, FID, and CLS.

GDPR-wise, embeds only collect data on submit. No behavioural tracking, no fingerprinting, no analytics pings. Read our full privacy policy for details.

Ready to embed? Grab your form from the dashboard, or start by building a free form online in 2 minutes.

Frequently asked questions

How do I embed a form on my website?

Open your form in CraftForm, click Embed, copy the snippet, and paste it into your site's HTML or a code block. Works in WordPress, Webflow, Next.js, React, Framer, Notion, Shopify, and plain HTML.

Is embedding a form free?

Yes. CraftForm embeds are free on every plan including the free plan. No watermark, no response caps, no branding.

Does the embed slow down my page?

No. The embed script is under 8kb gzipped and loads asynchronously. Lighthouse impact on LCP and CLS is negligible.

Can I embed a CraftForm on WordPress without a plugin?

Yes. Use a Custom HTML block and paste the snippet. No plugin, no shortcode, no premium upgrade.

Can I prefill form fields from the URL?

Yes. Pass values as query parameters — email, name, company, plan — and the form arrives pre-populated. Works with both inline and popup embeds.

Does the embed work on mobile?

Yes. All embed modes are fully responsive and auto-resize to the device width.

Is it GDPR compliant?

Yes. The embed sets no cookies, does no tracking, and only collects data on form submit. We also provide a DPA on request.

Ready to build?

Start building your form in 60 seconds.

Unlimited forms, unlimited responses, no credit card, no trial. CraftForm is free forever for the essentials.

Start free — no signup