Skip to content
Guide · Under the hood

How Framer to Next.js conversion works (without AI)

A technical look at converting Framer to React deterministically: published modules, source maps, import graphs, AST analysis of handlers, overlays, variants.

Short answer

FrameToNext fetches the published HTML, JavaScript modules and source maps, follows every import, and parses the code into a Babel syntax tree without running it. From that tree it extracts routes, components, event handlers, overlays, variants, transitions and breakpoints, then writes a Next.js project and builds it. No AI is involved.

Most ways of exporting a Framer site start from the rendered page: they save the HTML, take screenshots, or watch the DOM in a browser. That loses the most valuable part, the behaviour. FrameToNext starts from the code your site publishes instead.

Why the DOM is not enough

Framer sites are React apps. React attaches event listeners once, at the root, and dispatches events itself. So a menu button in the rendered page has no onclick you could read: what it does lives in the component code. To keep a button's behaviour you have to read that code.

1. Discovery

FrameToNext fetches your published HTML and finds the type=module scripts and modulepreload links Framer adds. It downloads those modules and, when they are published, their source maps with the original source text. The addresses and hashes change with every publish, so they are discovered fresh on every run, never stored.

Source maps are not always available. When they are missing, the published bundles themselves are parsed.

2. The module graph

Starting from the entry module, every import is followed: other site modules, Framer's own #framer/local/... specifiers, remote component modules and npm packages. Each npm package is pinned to an exact version and its license is recorded, so the project you get has an ordinary package.json.

3. Analysis as data

Each module is parsed into a syntax tree with Babel. The tree is read, never run: your site's JavaScript does not execute during analysis. From it FrameToNext extracts:

  • Routes, from the route table in the main module.
  • Components and their variants, including breakpoint variants.
  • Event props such as onTap, onClick, onMouseEnter, onHoverStart and onSubmit.
  • The handlers those props call, followed across modules when they are imported.
  • Overlay state (open, toggle, hide), variant switches and the transitions they use.

4. Code generation

From that model FrameToNext writes the Next.js project: routes, .tsx components, CSS and local assets. Framer APIs like links, overlays, responsive variants and Motion helpers are replaced by small, independent React functions shipped inside the project as source code, so nothing depends on Framer's hosted runtime.

5. Clean up and build

The generated project is formatted and renamed using only names found in your site, its stylesheet is checked rule by rule after reformatting, then it is installed, type-checked and built with next build. A conversion is only offered when that build succeeds.

Deterministic by design

No language model is used for extraction, conversion or repairs. The same published site gives the same project, and everything that could not be converted is written to the report instead of being guessed.

Frequently asked questions

Why not read interactions from the DOM?

React attaches event listeners at the root, so a button in the rendered page has no handler you can read. The behaviour is in the component code.

What if a site has no source maps?

The published bundles themselves are parsed instead.

Related guides

Your Framer site, as code you own.

Converting is free. See the pages and every file before you pay anything.