---
title: "Framer Scroll Animations in Next.js with Motion | Deframer"
description: "Framer scroll animations in Next.js: appear on scroll, scroll transforms, parallax and sticky sections on motion/react, plus reduced motion and speed."
url: https://deframer.co/blog/keeping-framer-animations-in-nextjs-with-motion
---

# Framer animations and scroll effects in Next.js with motion

Framer animations in Next.js: appear effects, scroll transforms, parallax, sticky sections, hover states and page transitions on motion/react.

Deframer

**Published**

29 September 2026

**Updated**

1 November 2026

**Reading time**

12 min

- [Animations](https://deframer.co/blog?tag=animations)
- [Motion](https://deframer.co/blog?tag=motion)
- [Framer](https://deframer.co/blog?tag=framer)
- [Next.js](https://deframer.co/blog?tag=nextjs)

![Deframer cover: “Every spring, still springy.” Beside it, a list of Appear effects, Hover states, Variants and Page transitions with Appear effects selected](https://deframer.co/_next/image?url=%2Fapi%2Fcms%2Fmedia%2Ffile%2Fkeeping-framer-animations-in-nextjs-with-motion.webp&w=3840&q=75)

Framer animations carry over to Next.js as plain TypeScript on the `motion` package (`motion/react`, formerly framer-motion). In a project converted by Deframer, appear effects, scroll-triggered and scroll-linked transforms, Scroll Speed parallax, sticky layers, hover and press states, variants and page transitions keep their timing, and springs keep their stiffness, damping and mass. A small helper kit in `src/lib/deframer` plays them, with no Framer runtime. Animations run on motion the same way if you convert to [TanStack Start](https://deframer.co/framer-to-tanstack-start), [Astro](https://deframer.co/framer-to-astro), [React Router](https://deframer.co/framer-to-react-router) or [Vite](https://deframer.co/framer-to-vite) instead.

This guide shows where each kind of animation lives in the converted project, how scroll effects work and how to build new ones with `useScroll`, `useTransform` and `whileInView`, how to tune a spring, how reduced motion is handled, how to keep scroll effects fast, and how to check that everything still feels right.

## What carries over, and where it lives

Framer stores animations as properties on layers and components. In the converted project they become named constants and props in ordinary `.tsx` files.

| In Framer | In the converted project |
| --- | --- |
| Transitions (spring or tween) | `const transition1 = { … } as const` near the top of the component or view file |
| Appear effects | Animation objects in the view (`animation`, `animation1` …) applied through kit helpers |
| Appear on scroll (layer or section in view) | The same objects, played when the layer reaches its threshold |
| Scroll transforms | `__fx_transformTargets` and `__fx_transformTrigger` props on a `withFX` element |
| Scroll Speed (parallax) | `__fx_parallaxTransformEnabled` and `__fx_speed` props on a `withFX` element |
| Sticky position | CSS `position: sticky` with its offsets |
| Loop effects | `__fx_loop…` props on a `withFX` element |
| Hover and press states | Variant states on the component, played by `motion` |
| Component variants | Human-readable names such as `variant === "Desktop"` with a CSS class per variant |
| Page transitions | `pageEffects` in `src/site/routes.ts` |
| Reduced-motion site setting | `reducedMotion` in `src/site/routes.ts` |

The kit lives in `src/lib/deframer` and is imported as `@/deframer`. It is an original, compact reimplementation of the runtime APIs the generated code calls, not Framer's runtime, and only the modules your site uses are kept. Deframer is an independent tool and is not affiliated with, endorsed or sponsored by Framer.

If you want the full tour of the folders first, read [what you get in a converted Next.js project](https://deframer.co/blog/what-you-get-in-a-converted-nextjs-project).

### Transitions

A transition in a converted component looks like this (real output from a converted template):

tsx

```
const transition1 = { damping: 30, delay: 0, mass: 1, stiffness: 500, type: "spring" } as const;
const transition2 = { damping: 30, delay: 0.1, mass: 1, stiffness: 80, type: "spring" } as const;
```

Tweens keep their duration and cubic-bezier easing:

tsx

```
const transition1 = { delay: 0, duration: 0.45, ease: [0.44, 0, 0.56, 1], type: "tween" } as const;
```

Some Framer springs are defined by duration and bounce rather than physics values, and those stay that way too, for example `{ bounce: 0.2, delay: 0, duration: 0.4, type: "spring" }`. The `as const` keeps the literal types, so TypeScript knows `type` is exactly `"spring"`.

### Appear effects

Appear animations become pairs of objects in the page view: a starting state and a target state with its transition.

tsx

```
const transition1 = { damping: 30, delay: 0.05, mass: 1, stiffness: 80, type: "spring" } as const;

const animation = { opacity: 1, rotate: 0, scale: 1, x: 0, y: 0, transition: transition1 /* … */ } as const;
const animation1 = { opacity: 0.001, rotate: 0, scale: 1, x: 0, y: 40 /* … */ };
```

The server render paints the starting state, so visitors don't see a flash of final content, and `motion` plays the target state as soon as the page hydrates. Appear effects set to play on scroll start when the layer enters the viewport.

### Hover, press and variants

Components that react to the pointer declare which variants have gestures enabled, and the variant names stay readable:

tsx

```
const enabledGestures = {
  Button: { hover: true },
  "Button Small": { hover: true },
};
```

The element itself is a `motion` element (`<motion.a>`, `<motion.div>`), and the CSS module holds a class per variant, so many visual differences between states are plain CSS you can inspect in the browser.

### Page transitions

Page transitions are site-wide data in `src/site/routes.ts`: a global enter effect plus per-route overrides.

ts

```
export const pageEffects = {
  global: {
    enter: {
      opacity: 0,
      scale: 1,
      transition: { duration: 0.2, ease: [0.44, 0, 0.56, 1], type: "tween" /* … */ },
      // …
    },
  },
};
```

## How do Framer scroll animations work in Next.js?

Framer's scroll effects become props on elements wrapped with the kit's `withFX` helper, and the kit plays them with `motion`'s scroll and in-view utilities. The server render paints each effect's starting state, and the effect starts moving once the page hydrates. There are four kinds, and they map to Framer's effect settings like this.

| Effect in Framer | What it does | In the converted project |
| --- | --- | --- |
| Appear, triggered by layer or section in view | Plays once (or every time) when the element reaches a threshold | Appear options on a `withFX` element (`__fx_animateOnce`, `__fx_threshold`, and `__fx_targets` for sections) |
| Scroll transform | Ties opacity, offset, scale or rotation to scroll position | `__fx_transformTargets` plus `__fx_transformTrigger`: `"onScroll"`, `"onInView"` or `"onScrollTarget"` |
| Scroll Speed | Moves a layer faster or slower than the page (parallax) | `__fx_parallaxTransformEnabled` and `__fx_speed` (a percentage of scroll speed) |
| Sticky | Holds a layer in place while its parent scrolls past | CSS `position: sticky` with its top, right, bottom or left offset |

### Scroll-triggered appear effects

A scroll-triggered appear effect runs once when the element enters the viewport, rather than following the scroll. The kit watches each element with a shared `IntersectionObserver` and animates from the starting state to the target state, with the effect's own transition. Two details match Framer's behavior: the visible share is measured against the smaller of the element's height and the viewport's, so a tall section can still reach a threshold like 0.5, and an effect without "once" plays again each time the element re-enters. Effects tied to a section (Framer's section-in-view trigger) list that section in their targets, so they play when the section, not the layer itself, scrolls into place.

### Scroll-linked transforms

A scroll transform maps scroll position to style values, so the element moves as the reader scrolls. The trigger decides which scroll range is used:

- `"onScroll"`: the page's scroll progress, top to bottom;
- `"onInView"`: from when the element's top enters the viewport until its bottom reaches the viewport's bottom;
- `"onScrollTarget"`: ranges between the sections the effect names, each with its own target values.

Values between targets are interpolated, and a configured spring smooths them through `animate` instead of setting them directly. On the element, it reads roughly like this (illustrative; your file has its own names and values):

tsx

```
const MotionDivWithFX = withFX(motion.div);

<MotionDivWithFX
  __fx_styleTransformEffectEnabled
  __fx_transformTrigger="onInView"
  __fx_transformTargets={[{ target: { opacity: 0, y: 80 } }, { target: { opacity: 1, y: 0 } }]}
/>
```

To change the effect, edit the target values. To remove it, delete the `__fx_` props, or render a plain element.

### Parallax with Scroll Speed

Framer's Scroll Speed becomes `__fx_speed`, a percentage of the page's scroll speed: 100 moves with the page, values below 100 lag behind (a background feel), values above 100 move ahead. The kit measures the element once it first comes into view, then shifts it vertically on every scroll frame. A speed of exactly 100 does nothing, so that is also a quick way to switch parallax off while you test.

### Sticky sections

Sticky layers are not animations at all: they are CSS `position: sticky` with the offset you set in Framer, plus `will-change: transform` and a `z-index` of 1. They only stick while their parent is taller than the viewport, so if a sticky section stops sticking after you edit the layout, check the parent's height and any `overflow` set on an ancestor, which disables sticky positioning.

## Building your own scroll effects with motion

You can add scroll animations of your own with `motion`'s documented APIs, independent of the kit. Put them in client components (`"use client"`) and keep everything else on the server. The [motion scroll animation docs](https://motion.dev/docs/react-scroll-animations) cover both kinds in depth.

**Scroll-triggered:** `whileInView`**.** The `FadeIn` example below in "Adding a new animation" is the whole pattern: `initial`, `whileInView`, and `viewport={{ once: true }}` so it plays only the first time.

**Scroll-linked parallax:** `useScroll` **and** `useTransform`**.** `useScroll` with a `target` ref gives that element's progress through the viewport from 0 to 1, and `useTransform` maps it to a style value:

tsx

```
"use client";

import { motion, useScroll, useTransform } from "motion/react";
import { useRef } from "react";

export function ParallaxImage({ src, alt }: { src: string; alt: string }) {
  const ref = useRef<HTMLDivElement>(null);
  const { scrollYProgress } = useScroll({ target: ref, offset: ["start end", "end start"] });
  const y = useTransform(scrollYProgress, [0, 1], ["-10%", "10%"]);

  return (
    <div ref={ref} style={{ overflow: "hidden", position: "relative", aspectRatio: "16 / 9" }}>
      <motion.img src={src} alt={alt} style={{ y, position: "absolute", inset: "-10% 0", width: "100%", height: "120%", objectFit: "cover" }} />
    </div>
  );
}
```

**Sticky scroll section with progress.** Combine a tall outer element, a sticky inner one, and the outer element's scroll progress:

tsx

```
"use client";

import { motion, useScroll, useTransform } from "motion/react";
import { useRef } from "react";

export function StickySteps({ steps }: { steps: string[] }) {
  const ref = useRef<HTMLElement>(null);
  const { scrollYProgress } = useScroll({ target: ref, offset: ["start start", "end end"] });
  const width = useTransform(scrollYProgress, [0, 1], ["0%", "100%"]);

  return (
    <section ref={ref} style={{ height: `${steps.length * 100}vh` }}>
      <div style={{ position: "sticky", top: 0, height: "100vh", display: "grid", placeItems: "center" }}>
        <motion.div style={{ width, height: 4, background: "currentColor", position: "absolute", top: 0, left: 0 }} />
        <ol>{steps.map((step) => <li key={step}>{step}</li>)}</ol>
      </div>
    </section>
  );
}
```

Wrap a scroll value in `useSpring` if you want it smoothed rather than locked to the scroll position. These are new files you add, for example `src/components/parallax-image.tsx`; nothing in the converted project depends on them.

## How to edit a spring

Say a menu opens too slowly. Here is the safe way to tune it.

1. Run the project locally with `npm install` and `npm run dev`, and open the page with the menu.
2. Find the component file. Components sit in `src/components/`, named after the designer's components and folders (for example `src/components/nav-menu.tsx`). Searching the project for the layer name usually gets you there fastest.
3. Find the transition constant the element uses. Look for `transition={transition2}` or `__fx_animate={{ transition: transition2 }}` and follow it to the constant at the top of the file.
4. Change one value at a time. Raising `stiffness` makes the spring faster and snappier; raising `damping` reduces overshoot; raising `mass` makes it feel heavier and slower to settle.

tsx

```
   // before
   const transition2 = { damping: 30, delay: 0.1, mass: 1, stiffness: 80, type: "spring" } as const;
   // after: quicker, still without overshoot
   const transition2 = { damping: 30, delay: 0.1, mass: 1, stiffness: 200, type: "spring" } as const;
```

1. Save and watch the hot reload. If the same feel should apply elsewhere, move the constant into a shared file (for example add `src/styles/motion.ts`) and import it, rather than copying numbers around.

Constants are per file, so `transition1` in one component is unrelated to `transition1` in another. Renaming them to something descriptive (`menuOpen`, `cardHover`) is a good first refactor once you know which is which.

## Adding a new animation

You are not limited to what came from Framer. Any component that already runs in the browser (it starts with `"use client"`) can use `motion` directly:

tsx

```
"use client";

import { motion } from "motion/react";

export function FadeIn({ children }: { children: React.ReactNode }) {
  return (
    <motion.div
      initial={{ opacity: 0, y: 16 }}
      whileInView={{ opacity: 1, y: 0 }}
      viewport={{ once: true }}
      transition={{ type: "spring", stiffness: 300, damping: 30 }}
    >
      {children}
    </motion.div>
  );
}
```

This is a new file you would add yourself, for example `src/components/fade-in.tsx`. `viewport` also takes `amount` (how much of the element must be visible) and `margin`, if you need the reveal to start earlier or later. Keep server components free of `motion` and wrap only the parts that animate.

## Reduced motion

Framer has a site setting for whether animations respect the visitor's reduced-motion preference, and the converted project keeps your choice in `src/site/routes.ts`:

ts

```
/** "user": honour prefers-reduced-motion (site setting); "never": always animate. */
export const reducedMotion = "never";
```

The kit passes this value to `motion`'s `MotionConfig`. With `"user"`, visitors who ask their operating system for less motion get transforms that jump straight to their end state while opacity still fades. The same applies to scroll effects: scroll transforms keep only their opacity part, and Scroll Speed parallax doesn't start, so the layer stays where the layout puts it.

For scroll effects you add yourself, check the preference with motion's `useReducedMotion` hook and skip the transform, or wrap your components in the same `MotionConfig`. Large parallax and scroll-linked movement are exactly the effects that cause discomfort for people with vestibular disorders, so treat this as part of the feature, not an extra. If your site was set to always animate, consider switching to `"user"`: it's a one-word change and an accessibility improvement for people sensitive to movement.

## Keeping scroll animations fast

Scroll effects run on every scroll frame, so they are the animations most likely to cost smoothness. A few rules keep them cheap:

1. **Animate transforms and opacity only.** `x`, `y`, `scale`, `rotate` and `opacity` can be composited by the browser; animating `width`, `height`, `top` or `box-shadow` forces layout or paint on every frame. The kit's scroll effects already limit themselves to transform and opacity channels.
2. **Prefer** `whileInView` **for one-off reveals.** A reveal that plays once needs an intersection check, not a per-frame scroll listener. motion pools its `IntersectionObserver`, and the kit shares one observer per option set.
3. **Don't stack many parallax layers.** Each moving layer gets `will-change: transform`, which costs memory on the GPU. A handful per page is fine; dozens of large images is not.
4. **Measure on a real phone.** Record a scroll in the Chrome DevTools Performance panel with CPU throttling, and look for long tasks while scrolling. Heavy images and third-party scripts are the usual cause, not the effect itself.

motion runs `useScroll`-driven animations on the browser's native scroll timeline where it can, and falls back to JavaScript otherwise, according to its documentation.

## Testing animations after conversion

Animations are where small differences are easiest to feel, so check them deliberately.

1. **Compare side by side.** When a live preview is available, the compare view shows the original and the converted site together at 1440, 768 and 390 pixels wide, with synced scrolling. A live preview lasts 10 minutes once it is ready, so plan what you want to check first. Otherwise, open the original beside the project running locally.
2. **Check every breakpoint.** Variants often differ between Desktop, Tablet and Phone. The [breakpoints guide](https://deframer.co/blog/framer-breakpoints-and-responsive-layouts-in-nextjs) explains how those layouts are split.
3. **Test reduced motion.** In Chrome DevTools, open the Rendering panel and emulate `prefers-reduced-motion: reduce`, then reload.
4. **Test a production build.** Run `npm run build` and `npm run start`. Development mode adds overhead, so judge smoothness on the production build.
5. **Read the notices.** The result page lists anything that needed attention, such as components that render only in the browser or Framer features replaced by placeholders. If an animated element is affected, it will be named there.

If an animation looks janky on a real device, the cause is usually heavy images or third-party scripts rather than the animation itself; [performance tuning a converted site](https://deframer.co/blog/performance-tuning-a-converted-framer-site) covers how to measure that.

## FAQ

### Do I need framer-motion installed?

No. The project depends on `motion`, the same library under its current package name, imported as `motion/react`. It is pinned in `package.json` along with Next.js, React and the site's other packages.

### Are spring values exactly the same as in Framer?

Yes, springs keep their stiffness, damping and mass, and tweens keep their duration and easing. The result is close to the original but not guaranteed identical, so compare the pages that matter most, as the [FAQ](https://deframer.co/#faq) recommends.

### Can I remove an animation completely?

Yes. Set the starting state equal to the end state, or render a plain element instead of the `motion` one. Because the code is ordinary TypeScript, you can delete what you don't need, and your editor will flag constants that are no longer used.

### How do I make Framer scroll animations work in Next.js?

Convert the published site and they come along: appear-on-scroll effects, scroll transforms and Scroll Speed parallax become `__fx_` props on `withFX` elements, played by `motion`, and sticky layers become CSS `position: sticky`. For new effects, use motion's `whileInView`, `useScroll` and `useTransform` in a client component.

### Why is my parallax or scroll effect not moving?

Check three things: the site's `reducedMotion` setting together with your system's reduced-motion preference (parallax doesn't run when motion is reduced), a `__fx_speed` of exactly 100, which means no parallax, and for sticky layers an ancestor with `overflow` set or a parent no taller than the viewport.

### Do scroll animations hurt performance or Core Web Vitals?

Not much when they animate only transform and opacity, which is what the converted effects do. Content is server-rendered in its starting state, so it is in the HTML from the first response; heavy images and third-party scripts usually matter more, as [performance tuning a converted site](https://deframer.co/blog/performance-tuning-a-converted-framer-site) shows.

Deframer

## Move your Framer site to clean code.

Convert your site free, review the result, then download it as a TypeScript project you own: Next.js, Astro, React, TanStack Start, React Router, Nuxt or HTML.

[Convert your site](https://deframer.co/dashboard)[Pricing](https://deframer.co/pricing)

## Keep reading

[All posts](https://deframer.co/blog)

- ![Deframer cover: “Every problem, with a fix.” Beside it, four tiles, Layout, Animations, CMS and Builds, with Animations selected](https://deframer.co/_next/image?url=%2Fapi%2Fcms%2Fmedia%2Ffile%2Fframer-to-nextjs-migration-problems.webp&w=3840&q=75)

  Migration 25 Oct 2026 15 min read

  ### [Framer to Next.js migration problems: a database of real issues and fixes](https://deframer.co/blog/framer-to-nextjs-migration-problems)

  Real Framer to Next.js migration problems by category, each with symptoms, cause, fix and whether Deframer handles it, from our own test runs and code.
- ![Deframer cover: “Five sites, real results.” Beside it, a list of Landing, Agency, Portfolio, CMS blog and Multilingual with Multilingual selected](https://deframer.co/_next/image?url=%2Fapi%2Fcms%2Fmedia%2Ffile%2Fframer-to-nextjs-conversion-tests.webp&w=3840&q=75)

  Migration 25 Oct 2026 8 min read

  ### [Framer to Next.js: real conversion tests on five different websites](https://deframer.co/blog/framer-to-nextjs-conversion-tests)

  We converted five public Framer sites to Next.js and measured routes, builds, pixel differences and errors: what worked, what broke, what we fixed.
- ![Deframer cover: “Same test, both sides.” Beside it, two cards, Framer site to Next.js, with Next.js selected](https://deframer.co/_next/image?url=%2Fapi%2Fcms%2Fmedia%2Ffile%2Fframer-pagespeed-before-and-after-conversion.webp&w=3840&q=75)

  Performance 27 Sep 2026 4 min read

  ### [How to compare a Framer site's PageSpeed before and after converting](https://deframer.co/blog/framer-pagespeed-before-and-after-conversion)

  Compare your Framer site's PageSpeed Insights scores with the converted Next.js version: what to measure and how to read it fairly.
