Framer to Next.js: Component-by-Component Migration Guide
A practical guide to converting Framer components, animations, and interactions into clean Next.js React code — without losing what made your site special.
MigrateLab Team
Migration Experts

Why Next.js Is the Natural Home for Framer Designs
Here's something most migration guides won't tell you: Framer and Next.js share more DNA than you'd think. Under the hood, Framer renders your site using React. Its animations use framer-motion — the exact same library you'd use in a Next.js project. The transition from Framer to Next.js isn't a leap to a foreign platform. It's more like graduating from a managed React playground to the full React ecosystem.
The advantage is enormous. Every animation, every interaction, every component pattern you built in Framer has a direct equivalent in Next.js. You're not starting over. You're upgrading.
Next.js gives you everything Framer provides — server-side rendering, automatic code splitting, image optimization — plus everything Framer can't: custom API routes, database access, authentication, middleware, and full control over your deployment infrastructure. And crucially, your entire codebase becomes editable by AI tools like Claude Code, which can refactor components, add features, and fix bugs in seconds.
The Component Mapping: Framer Modules to React Components
Every Framer site is built from modules — visual building blocks that snap together on the canvas. Each one has a direct React equivalent. Understanding this mapping is the key to a clean migration.
Stack and Frame → div and Flexbox/Grid
Framer's Stack component arranges children in a row or column with spacing. In React, this is simply a div with CSS Flexbox or Grid. The Stack's direction, gap, padding, and alignment properties translate directly to CSS flex properties.
In Framer, you'd configure a Stack with direction='vertical', gap=24, padding=32. In Next.js with Tailwind, that becomes a div with className="flex flex-col gap-6 p-8". It's more explicit, and AI tools understand it perfectly.
Framer Text → HTML Typography
Framer's text layers become standard HTML elements. Headings become h1-h6 tags. Body text becomes paragraph tags. The key difference: in Framer, typography is defined per-element. In Next.js, you define a typography system once and reuse it everywhere. This is actually better — it forces consistency that Framer's freeform approach often lacks.
Framer Image → next/image
Next.js has a built-in Image component that automatically handles responsive sizing, lazy loading, WebP conversion, and CDN optimization. It's genuinely better than Framer's image handling. Your images will load faster, weigh less, and look sharper after migration. The next/image component handles srcSet generation, blur placeholders, and priority loading that you'd need to configure manually in Framer.
Framer Scroll → CSS Overflow and Intersection Observer
Framer's Scroll component provides scrollable containers with various effects. In Next.js, you use native CSS overflow properties for basic scrolling. For scroll-triggered animations, the Intersection Observer API combined with framer-motion's useInView hook gives you more control than Framer's visual editor allows. You can trigger animations based on scroll position, viewport entry, and scroll velocity — all with granular control.
Framer Link → Next.js Link
Next.js provides a Link component that handles client-side navigation with automatic prefetching. This is functionally identical to Framer's links, but with one significant advantage: you get automatic route prefetching. When a Link enters the viewport, Next.js prefetches the target page in the background. Users experience near-instant navigation.
Framer Input → HTML Form Elements
Framer's form components have limited functionality — basic input fields with styling options. In Next.js, you get the full power of HTML forms with proper validation, accessibility attributes, error states, and submission handling. Libraries like React Hook Form add schema validation, conditional fields, and multi-step forms that Framer simply can't do.
Handling Framer Motion Animations
This is the best part of a Framer-to-Next.js migration: your animations translate almost directly. Framer uses the framer-motion library internally for all its animations. When you migrate to Next.js, you install the same library and write the same animation logic — just in code instead of through a visual interface.
Entrance Animations
In Framer, you configure entrance animations through the Appear panel: fade in, slide up, scale up. In framer-motion code, these become initial and animate props on motion components. A component that fades in and slides up in Framer becomes a motion.div with initial={{ opacity: 0, y: 20 }} and animate={{ opacity: 1, y: 0 }}. The transition timing, easing curves, and delay values transfer directly.
Hover and Tap Interactions
Framer's hover and tap states become whileHover and whileTap props on motion components. Every scale, color change, and shadow effect you configured in Framer's visual editor has a direct code equivalent. The difference: in code, you can compose these interactions, chain them, and make them conditional based on state. That button that scales on hover? In Next.js, it can also change its animation based on whether the user is logged in, or whether the form has been submitted.
Page Transitions
Framer provides built-in page transitions — fade, slide, push. In Next.js, you implement page transitions using AnimatePresence from framer-motion wrapped around your page content. The result is identical, but you gain the ability to create custom transition choreographies. Individual elements can animate out in a staggered sequence, headers can persist while content transitions, and loading states can be gracefully animated.
Scroll-Triggered Animations
Framer's scroll animations — parallax, scroll-linked opacity, scroll-triggered entrance — translate to framer-motion's useScroll and useTransform hooks. These hooks give you a reactive value tied to scroll position that you can map to any CSS property. Parallax effects, progress indicators, and scroll-driven color changes all work the same way — with the advantage of precise control over timing functions and scroll ranges.
CMS Content: Framer CMS to Headless CMS
If you're using Framer's built-in CMS, you need a replacement. Framer's CMS is convenient but limited: no API access, no webhooks, no content relationships, and a hard limit of 1,000 items per collection.
For most Next.js migrations, we recommend Payload CMS — it's open-source, self-hosted, and gives you a full admin panel with rich text editing, media management, and custom fields. Other solid options include Sanity, Contentful, or Strapi, depending on your team's preferences.
The migration process for CMS content:
- Export from Framer. Framer doesn't have a built-in export. You'll need to scrape your CMS pages or manually extract content. For blogs with fewer than 50 posts, manual copy-paste into your new CMS is often faster than writing a scraping script.
- Map your content model. Framer CMS collections become CMS collections in your new system. Each field type needs a corresponding field in Payload (or your chosen CMS). Rich text, images, references between collections — all need to be mapped.
- Import and verify. Import content via the CMS admin panel or API. Then check every piece: rich text formatting, images, links, and relationships. Automated import scripts save time but always need manual verification.
Routing and Page Structure
Framer uses a flat page structure with URL paths configured per page. Next.js uses a file-system based router where each file in the app directory becomes a route. This is actually more intuitive once you get used to it.
Your Framer pages map to Next.js like this:
- Framer homepage → app/page.tsx
- Framer /about → app/about/page.tsx
- Framer /blog/:slug → app/blog/[slug]/page.tsx (dynamic route)
- Framer /pricing → app/pricing/page.tsx
Dynamic routes in Framer (CMS-powered pages like blog posts or case studies) become dynamic route segments in Next.js. The [slug] in the file name tells Next.js to match any value in that URL segment and pass it as a parameter to your page component.
One major upgrade: Next.js supports nested layouts. Your header, footer, and sidebar can be defined once in a layout.tsx file and automatically wrap every page. In Framer, you'd copy these elements to every page or use components — but changes to the navigation required updating every instance.
What Doesn't Translate (And What Improves)
Not everything carries over directly. Here's an honest assessment:
What you lose (temporarily)
- Visual editing. You can't drag and drop elements anymore. But with AI coding tools, you describe changes in plain English and they happen in seconds. Most teams find this faster than visual editing within a month.
- Instant prototyping. Framer is unbeatable for quick visual prototypes. For prototyping, keep using Framer or Figma. Your production site is what needs to be in code.
- Built-in analytics. Framer includes basic analytics. In Next.js, add Plausible or Umami for privacy-friendly analytics, or Google Analytics for the full suite. Setup takes 5 minutes.
What improves immediately
- Performance. Framer sites average 2-3 second load times. A well-built Next.js site loads in under a second. Server-side rendering, automatic code splitting, and image optimization make a dramatic difference.
- SEO. Full control over meta tags, structured data, canonical URLs, and sitemaps. Dynamic OG images. Server-side rendered content that search engines can crawl instantly.
- Functionality. API routes, database access, authentication, payment processing, email sending — everything that required third-party hacks in Framer becomes native code.
- Cost. Framer Pro costs $20-30/month. A Next.js site on Vercel's free tier or a $5/month VPS costs a fraction of that. At scale, the savings are significant.
- AI editability. Your entire codebase is readable, understandable, and editable by AI tools. This is the single biggest long-term advantage.
| Feature | Framer Component | Next.js Equivalent |
|---|---|---|
| Stack / Frame | Visual layout tool | div + Flexbox/Grid + Tailwind |
| Text Layer | Per-element styling | Typography system (h1-h6, p) |
| Image | Basic optimization | next/image (WebP, srcSet, blur) |
| Scroll Component | Visual scroll config | CSS overflow + Intersection Observer |
| Link | Basic navigation | next/link (prefetching) |
| Animations | Visual framer-motion | Code framer-motion (same lib) |
| CMS | 1,000 item limit | Unlimited (Payload, Sanity, etc.) |
| Forms | Basic inputs | Full validation + submission logic |
5-Step Framer to Next.js Migration Process
Audit your Framer site
Document every page, component, animation, CMS collection, and third-party integration. Take screenshots of every unique layout. Export your CMS data and media assets.
Tip: Use browser DevTools to inspect Framer's generated HTML and note the framer-motion animation values — these transfer directly to your Next.js code.
Set up your Next.js project with design tokens
Create a Next.js 15 project with Tailwind CSS. Extract your Framer design system — colors, fonts, spacing, breakpoints — and configure them as Tailwind theme values. Set up your CMS (Payload, Sanity, or Contentful) and deployment pipeline.
Tip: Match your Framer color palette and font stack exactly in tailwind.config.ts to ensure visual consistency from day one.
Build your component library
Translate Framer modules into React components, starting with the most reused: navigation, footer, buttons, cards, and section layouts. Add framer-motion animations that match your Framer interactions.
Tip: Build mobile-first. Framer designs desktop-first, so this is your chance to fix responsive issues that have been lurking.
Migrate content and pages
Import your CMS content into the new headless CMS. Build each page template, populating it with real content. Set up dynamic routes for CMS-driven pages like blog posts and case studies.
Tip: Set up URL redirects from Framer URLs to new URLs before going live — this preserves your SEO rankings.
Test, optimize, and launch
Run Lighthouse audits on every page. Test on mobile devices and all major browsers. Verify all forms submit correctly. Check that every framer-motion animation performs smoothly. Then point your domain to the new site.
Tip: Keep your Framer site live on a subdomain for 30 days as a fallback. You can always revert if something was missed.
Need help migrating from Framer? We handle the technical heavy lifting so you can focus on your business.
Related Resources

Framer vs Custom Code in 2026: Performance, Cost & Flexibility Compared
An honest side-by-side comparison of building with Framer versus custom code in 2026 — performance benchmarks, real costs, and when each approach makes sense.

How to Export Your Content from Framer Without Losing Formatting
Framer doesn't have a CSV export. Here's how to extract your pages, blog posts, CMS collections, and media assets while preserving formatting and structure.

Hiring a Developer to Rebuild Your Framer Site: What to Know First
Thinking about hiring someone to migrate your Framer site? Here's how to evaluate developers, set expectations, avoid common pitfalls, and get a result you're proud of.

Framer to Code: What Nobody Tells You About the Migration
Framer makes beautiful sites. But when you need real functionality, custom integrations, or AI-powered workflows, you need code. Here's what the migration actually looks like.