Framer migration series
- Framer to Code: migrate to Next.js, React or Astro (you're here)
- Export your Framer site and host it anywhere
- Framer to WordPress (coming next)
Framer to code, in short: you can migrate a Framer website to React, Next.js, Astro or almost any framework by connecting Claude (or Cursor) to your Framer project through Framer's official connector and asking it to rebuild the site as code. The AI reads your pages, layers, styles and content, writes the codebase, and in my own migrations got 82 to 90% of the way there on the first prompt. A few follow-up prompts close the gap, and the result is a site you fully own and can host anywhere, including Cloudflare.
This is the workflow I wish existed when I started designing in Framer: design visually, with all the creative control Framer gives you, then take the result into real code instead of being locked into one platform.
Why I'm writing this
Over the past few weeks I've moved several of my own Framer sites to Astro this way, including landing pages with custom code components and animations. I build and teach in the creative developer community, on my YouTube channel and in my writing, and this question keeps coming up: "Can I design in Framer and still own my code?" There's no clear guide anywhere that answers it, so this is everything I learned from those migrations, including the parts that broke and how I fixed them.
Here's the detailed video breakdown of the whole process. The video is the source of truth for every part of this series. If you'd rather follow it visually, it walks through connecting Framer, the full setup and hosting the finished site, step by step.
Why design in Framer and then convert, instead of building in an AI site builder?
When you design a website in an AI builder, you never fully control the result. Even if you hand it every design resource you have, the AI is still guessing, because those resources don't give it structured CSS data. Every change is another prompt: you describe the spacing, the AI guesses, you prompt again, and the design drifts away from what you had in mind.
Framer and Figma are different. Through MCP, they hand the AI the actual CSS of your visual design: exact spacing, colors, typography and layout. Nothing is left to interpretation.
Of the two, I put Framer first (watch this part). It gives you full design control, built-in effects and interactions, and its own AI agent for creating custom modern effects.
So the split is simple:
- You design in Framer, with full control over layout, type, spacing and motion.
- The AI converts the finished design into React, Next.js or Astro.
- You own the code: version control, any host, any backend, no per-site platform plan.
You don't have to start from a Framer template
You're not limited to migrating a Framer template. You can go much further with community resources.
(Watch this part.) StackKit collects web design and development resources in one free hub. With the Framer browser plugin, which you can find as a Chrome extension, you can bring any of them straight into Framer in a structured way. From there, you edit and customize them, design every page and add your effects.
The same idea works for a site you already have. Bring a static website into Framer, add the interactions you always wanted, then convert it to whichever framework you like.
When the design is done, use the Framer MCP connector to migrate the whole site to code with an AI builder. Design with full control, then export to any framework you want.
Quick answer: how do you migrate Framer to code?
- Install Framer's connector in Claude or Cursor, and sign in with your Framer account.
- Start a new session in an empty folder, or connect a new GitHub repository for the code.
- Paste the migration prompt below and fill in the four placeholders: your Framer project link, the pages to convert, the framework, and where to store the code.
- Select Claude Fable 5.2 as the model and send it.
- Compare the result with your Framer site and fix what's off with follow-up prompts.
- Host it on Cloudflare with the hosting prompt further down.
In my tests the first build took 5 to 15 minutes, depending on how many pages the site has.
Can you export a Framer site?
Not with an export button. Framer's help center says it does not offer HTML export for self-hosting, because published sites rely on Framer's own servers. The supported way to serve a Framer site from your own domain setup is a reverse proxy, and the site still runs on Framer behind it.
Rebuilding the site as code, as this guide does, is how you get files you actually own. If what you want is plain HTML you can host anywhere, Part 2 covers it: Export your Framer site and host it anywhere.
Is it allowed to migrate a Framer site to code?
Yes, for your own project. The connector is Framer's own, you sign in with your Framer account, and the AI reads a project you have access to. There's no scraping of anyone else's site involved.
Two things to check before you start:
- Fonts. Some fonts you use in Framer are licensed for Framer only. Swap them for a Google Font or load font files you have a license for.
- Templates. If your site started from a Framer marketplace template, read that template's license. Some only allow use on Framer.
Why move a Framer site to code at all?
- You need a real backend: forms that write to your database, logins, payments, APIs.
- You want hosting freedom: Cloudflare, Vercel, Netlify or your own server. (Not sure which? See Cloudflare vs Vercel for vibe coders.)
- Cost across many sites: Framer bills per site, so an agency running a dozen client sites pays a dozen plans.
- Full ownership: Git history, code review, your own tooling.
- SEO control: rendering, structured data and performance tuned exactly how you want.
What you need before you start
- A paid Claude plan, or Cursor. Opus 5.5 is included in the regular Claude plans. Fable 5.2 is the most accurate, but on Claude Pro it runs on usage credits rather than your plan's limits.
- Framer's official connector added to Claude or Cursor.
- Your Framer project URL, from a project your account can open.
- A GitHub repository or a local folder for the new codebase.
- Node.js installed, if you want to run the site on your machine.
- A Cloudflare account and its connector, if you want the AI to host the site for you.
How to migrate Framer to React, Next.js or Astro, step by step
Step 1: Install the Framer connector and sign in
In the Claude app, open Settings, then Connectors, find Framer and connect it. You'll be asked to sign in with your Framer profile.
In Claude Code, add Framer's server from the terminal, then sign in:
claude mcp add --transport http framer https://mcp.framer.com/mcpIn Cursor, add the same server URL, https://mcp.framer.com/mcp, under Settings, then MCP, and sign in when it asks.
Step 2: Start a session where the code will live
Start a new session and open a folder you just created for the project, or connect a new GitHub repository to store the code.
Step 3: Copy the migration prompt and fill in the placeholders
Use the prompt in the next section. Replace the four placeholders at the top: your Framer project link, which pages to convert, the framework, and where to store the code (a local folder or your GitHub repository).
If you leave the framework open, you get React. Framer sites are built on React, so React is the natural default, and Next.js or Astro are a one-line change in the prompt.
Start with the landing page only. Once that matches, convert the rest in bulk or one page at a time.
Step 4: Select the model
Pick Claude Fable 5.2: it gives the most accurate first pass. Opus 5.5 costs less and works if your design is simple. The more complex the animations, the more Fable's extra accuracy pays for itself in fewer follow-up prompts. (For how these models compare on web work generally, see Fable 5.2 vs Gemini 4 Carbon vs Opus 5.5.)
Step 5: Answer its questions and let it work
It may ask about styling or where you plan to host. Answer before it starts. Decisions made up front save rework later.
Step 6: Review it against the live Framer site
Run the site locally and compare each page with your Framer version at desktop, tablet and phone widths. Write down every difference, then fix them in batches.
Step 7: Fix what's off with follow-up prompts
See the table of common issues further down.
Step 8: Host it
Use the Cloudflare hosting prompt below, or push to GitHub and deploy to Vercel or Netlify. Keep the Framer site live until the new one is checked.
The Framer to code migration prompt
Copy this and replace the four placeholders at the top:
Convert a Framer site into code with 100% accuracy.
1. Framer project: {Project link}
2. Pages to convert: {e.g. Home only} [Start with the landing page only, then convert the rest in bulk or one by one]
3. Framework: {e.g. Astro with React}
4. Where to store it: {local folder path, or GitHub repo URL to clone and push to}
Goal: the coded pages must look and behave the same as the Framer pages:
layout, fonts, colours, spacing, images, hover states, scroll-triggered
animations, transitions and every breakpoint. Do not redesign, simplify or
"improve" anything, and do not change any text or image. Content edits come
later, after I approve the copy.
How to work:
1. Read the project with the Framer connector first: pages, breakpoints, code
components, fonts, and the exact animation settings (variants, scroll
targets, spring and easing values, delays). Never guess a value you can
read.
2. Port from the real rendered page, not by eye. Open the published page in
a headless browser, scroll the whole page so everything loads, and capture
the rendered markup and Framer's own stylesheet at each breakpoint. Reuse
that markup and CSS as they are instead of rewriting them. If the page is
a draft or unpublished, ask me before publishing anything in Framer.
3. Download every font, image, video and SVG into the project so nothing
loads from Framer's servers.
4. Reuse Framer code components verbatim, with a small shim for the "framer"
import. Keep layer names and class names they depend on.
5. Rebuild interactions from measured values: which scroll position triggers
each state, how far each element moves, and the exact spring or easing
timing. When an element changes between states, animate the same element
moving and resizing as Framer does; do not cross-fade two copies.
6. Prove it matches before saying it is done. Compare the original and the
copy side by side: same total page height, screenshots every 500px of
scroll at each breakpoint, and frame-by-frame recordings of every
animation, scrolling down and back up. Fix differences and compare again
until they match.
7. Store the code where I said above, with clear commits. Do not deploy,
attach a domain, or change the Framer project unless I say so.
At the end, tell me plainly: what matches and how you checked it, anything
that does not match or that you could not check, and anything you had to
build differently from Framer and why.Three parts of this prompt do most of the work:
- "Never guess a value you can read." The connector exposes the real spacing, easing and breakpoints. Without this line, models still eyeball them.
- Porting from the rendered page. Reusing Framer's own markup and stylesheet is far more accurate than rebuilding the layout from a description.
- Keeping code components verbatim. Framer code components are already React, so there's no reason to rewrite them. A tiny stand-in for Framer's own helpers preserved their exact behaviour in my migrations.
How accurate is it, and how do you fix what breaks?
Let's be honest: it won't be 100% on the first attempt (watch this part). On my own site I got 82 to 90% on the first prompt, then refined it with follow-ups until it matched. These are the issues that came up most, with the prompts that fixed them:
| Issue | Why it happens | Fix prompt |
|---|---|---|
| Sticky or scroll animation doesn't match | Scroll-linked effects are the hardest thing to read from a design | "The sticky section on [page] doesn't pin like the Framer version. Rebuild it with [GSAP ScrollTrigger / Motion] to match exactly." |
| Hover micro-interaction missing or off | The interaction wasn't picked up | "Add the hover effect from the Framer [component]: scale, shadow and timing, using the values from the connector." |
| Fonts look different | Framer-only font licenses | "Replace [font] with the closest Google Font, or load my licensed font files from /fonts." |
| Spacing off on phones | Breakpoint values differ | "Compare [section] on mobile with Framer and match its padding and font sizes at 390px wide." |
| CMS content missing | Collections need their own pass | "Export every item in the [collection] CMS collection to Markdown or JSON and generate its pages." |
| A code component behaves differently | It relied on Framer's runtime | "Keep [component] as written and add the missing Framer helpers to the local shim." |
How do you host the converted site on Cloudflare?
Connect the Cloudflare connector in Claude, then ask Claude to host the site (watch this step). This is the prompt I use. It asks before touching anything you already have, and it never asks for your password or API token in chat.
My website code is ready in this session. Using my connected Cloudflare connector, host it on Cloudflare for me.
1. Check the project: confirm the framework (Next.js / Astro / React), install dependencies, and run a production build. Fix any build errors before deploying.
2. Pick the right Cloudflare setup:
- Static site (Astro, React/Vite, static Next.js export): Cloudflare Workers with static assets, or Cloudflare Pages
- Next.js with server features (API routes, SSR): Cloudflare Workers using the OpenNext Cloudflare adapter
Tell me which one you chose and why.
3. Create a new Cloudflare project named [YOUR-PROJECT-NAME] in my existing account. Do not change or delete any existing projects, domains or DNS records.
4. Add the config files it needs (wrangler.jsonc, build command, output directory) and deploy.
5. Give me the live *.workers.dev or *.pages.dev URL and check that every page loads, with links, images, fonts and animations working.
6. Custom domain: I will connect the domain myself. Give me step-by-step instructions for connecting it to this project, including the DNS records to add.
7. If the connector can't do a step, give me the exact command to run in my terminal (for example, npx wrangler deploy) instead of asking for my password or API token in chat.
At the end, give me a short summary: project name, live URL, the build settings used, and how to redeploy after future changes.If you'd rather compare hosts first, Cloudflare vs Vercel for vibe coders covers which one fits which kind of site.
What about the CMS?
The migration prompt brings your Framer CMS content across as files, so every page keeps its content. What you lose is Framer's visual editor for that content. If you or a client need to keep editing posts without touching code, connect a headless CMS to the new Astro, Next.js or React site. I'll cover that setup in a separate guide, so you get the same freedom you had in Framer.
Framer to Next.js, Astro or React: which should you choose?
Pick the framework for what the site needs to do next, not for what's popular.
| Target | Best for | Choose it if |
|---|---|---|
| Framer to Astro | Marketing, portfolio, local business and content sites | You want fast pages and strong SEO with minimal JavaScript |
| Framer to Next.js | Apps, SaaS, e-commerce, anything with a backend | You need logins, APIs, server rendering or dynamic pages |
| Framer to React (Vite) | Single-page apps and dashboards | You only need interactivity in the browser |
| Stay on Framer | Fast visual iteration | Your team edits visually and needs no custom backend |
Most Framer sites are marketing or portfolio sites, and for those I'd choose Astro, with React for the interactive parts. It's what I used for my own. For a deeper comparison, see Astro, React or Next.js: when should you use each?, and for ready-made toolsets, the Astro stack and the Next.js stack.
Framer to Next.js: what changes
Next.js is the growing choice for Framer migrations, because it gives a designed site somewhere to grow into an app. Set the framework line in the prompt to Next.js (App Router, TypeScript). Three things are worth knowing:
- Code components move over as they are. Framer code components are React, so they become client components (files that start with
"use client") with the same small shim for the framer import. - Static or server, your choice. A marketing site can use Next.js static export and be hosted anywhere as plain files. Add server features (API routes, logins, server rendering) only when you need them.
- Hosting. Vercel runs Next.js with no setup. On Cloudflare, a site with server features runs on Workers through the OpenNext Cloudflare adapter, which the hosting prompt above already picks for you.
Will you lose SEO when you move off Framer?
Not if you keep three things the same:
- The same URLs. Keep every page path identical. If any URL has to change, add a 301 redirect from the old one.
- The same titles and meta descriptions. Compare a few pages by hand after the build.
- A sitemap. Submit it to Google Search Console and Bing Webmaster Tools once the new site is live.
One upgrade worth making while you're in there: make sure every page sends its text in the HTML itself, not only after JavaScript runs. Most AI crawlers don't run JavaScript, so this is what lets ChatGPT and other assistants read the site. Astro does this by default. For getting the new site recommended by AI assistants, see our Bing-first playbook.
Should you leave Framer?
Not always. If you're looking at Framer alternatives, the real question is whether you need anything Framer can't give you.
- Stay on Framer if your team edits pages visually every week, the site needs no custom backend, and you run only a few sites.
- Move to code if you need a backend, you pay for many Framer sites, or you want your code in Git and your hosting under your control.
There's a middle path too: keep designing in Framer and convert whenever the design changes. That's the workflow this whole series is built on.
The short version
Design in Framer, where you have full creative control. Let Claude or Cursor, through Framer's official connector, turn that finished design into React, Next.js or Astro with the prompt above. Fix the last 10 to 20% with a few targeted prompts, keep your URLs, and host it on Cloudflare with the second prompt. Next in the series: Export your Framer site and host it anywhere. You keep the design you made, and the code is yours.