All posts
Web design & development

GSAP ScrollTrigger in Webflow: A Practical Guide

How to use GSAP in Webflow: enable the GSAP integration, add ScrollTrigger code or GSAP-powered interactions, and keep scroll effects fast and accessible.

By Mehdi Hassan9 min read

The short answer

To use GSAP with Webflow, turn on the GSAP integration in your site settings and tick ScrollTrigger, then either build the animation visually with Webflow's GSAP-powered interactions or write ScrollTrigger code in the page's Before body custom code. Register the plugin, animate transform and opacity, wrap everything in a reduced-motion check, and test on the published site.

Key takeaways

  • GSAP is now a Webflow product and free, plugins included; enable it under the GSAP integration in site settings.
  • Use Webflow's GSAP-powered interactions first; write ScrollTrigger code only for what the visual timeline can't do.
  • Custom code runs on the published or staging site, not in the Designer, so test there.
  • Never animate the same element with both a Webflow interaction and custom GSAP code.
  • Wrap scroll effects in gsap.matchMedia() so reduced-motion visitors get a static page.

Part of Motion Design for Marketing Websites: When Animation Helps and When It Hurts

GSAP and Webflow are now the same company, which changed how you add scroll animation to a Webflow site. You no longer paste CDN links and worry about plugin licenses. This guide walks through the setup, the patterns we actually use, and the guardrails that keep scroll effects from hurting speed or accessibility. It sits inside our website animation guide, which covers when motion is worth adding at all.

How do you use GSAP in Webflow in 2026?

You use GSAP in Webflow in one of two ways: visually, through Webflow's GSAP-powered interactions, or in code, by enabling the GSAP integration and writing scripts in custom code. Both run on the same library. The visual route gives you a timeline you can scrub and preview, with built-in ScrollTrigger and SplitText support and reusable animations, at no extra cost according to GSAP's own Webflow documentation.

The code route is for effects the visual timeline can't express: scroll logic that depends on calculated values, animations tied to CMS content in unusual ways, or behavior that responds to custom events. GSAP's documentation describes the integration as loading the core library and any plugins you tick, site-wide. If you only need GSAP on one page, you can instead load it with a script tag in that page's settings.

Approach

Best for

Who can edit it later

Watch out for

Webflow GSAP-powered interactions

Reveals, staggers, pinned sections, text splits

Anyone comfortable in the Designer

Complex logic gets hard to read in the panel

GSAP integration plus custom code

Calculated or conditional scroll logic

A developer

Doesn't run in the Designer canvas

Script tag on one page

A single heavy effect on one page

A developer

Version drift if pages load different copies

Our rule: start in the interactions panel, and only drop to code when you hit a wall.

How do you set up ScrollTrigger in Webflow?

Set up ScrollTrigger in Webflow by enabling the GSAP integration, ticking ScrollTrigger, and registering the plugin in your page's custom code before you use it. The steps below follow GSAP's documented Webflow setup. Menu names can move between Webflow releases, so check the current Webflow help center if a label looks different.

  1. Enable the GSAP integration

    Open your site settings, find the GSAP integration, and switch it on. This loads the core library across the site.

  2. Tick the plugins you need

    Check ScrollTrigger, plus SplitText if you animate headlines by line or word. Leave the rest off so you don't ship code nobody uses.

  3. Add a class or attribute hook

    Give the elements you'll animate a dedicated class or a custom data attribute, separate from their styling classes, so a designer renaming a style doesn't break the animation.

  4. Write the script before the closing body tag

    In Page settings, under Custom code, add your script in the Before body section. Wrap it in a DOMContentLoaded listener and call gsap.registerPlugin(ScrollTrigger) first.

  5. Publish to staging and test

    Custom code doesn't run in the Designer canvas, so publish to your webflow.io staging domain and test there, with ScrollTrigger's markers option on while you tune start and end points.

  6. Remove markers and refresh after layout changes

    Turn markers off before going live. If images, fonts or tabs change the page height after load, call ScrollTrigger.refresh() so trigger positions stay accurate.

Which GSAP scroll patterns work best on Webflow sites?

Four GSAP patterns cover most marketing sites: staggered reveals, scrubbed progress, pinned step-by-step sections and split-text headlines. Each has a clear job, and each has a version that goes too far. Use the job to decide, not the reference site that inspired you.

  • Staggered reveals. Cards or logos fade and rise in sequence as a section enters. Cheap and easy in the visual panel. Keep the distance small and the stagger short, or the reader waits for content.
  • Scrubbed progress. An element's state follows the scrollbar, such as a line drawing along a timeline. Good for showing order. Use scrub with a little smoothing rather than a hard one-to-one link.
  • Pinned steps. A section pins while three or four steps animate through, explaining how a product works. Powerful, but keep it short and check it on phones, where long pins feel like the page is stuck.
  • Split-text headlines. SplitText animates a heading by line or word. Use it on section headings, not on the hero headline, which should render immediately.

For the hero specifically, see hero section animation patterns, and for small hover and click feedback that doesn't need ScrollTrigger at all, see micro-interactions.

For example, suppose you're building a pinned 'how it works' section

For example, suppose a Webflow homepage has a 'how it works' section with three steps and a product illustration. The illustration pins on the right while the three step blocks scroll past on the left, and each step swaps a highlighted layer in the illustration.

In the interactions panel, you'd create one scroll-linked timeline on the section, pin the illustration wrapper, and add three labels where each layer's opacity changes. On mobile, you'd turn the pin off and stack the three steps with their own small illustration, because side-by-side pinning doesn't fit a narrow screen. In code, the same split is a gsap.matchMedia() block with one setup for wide screens and a simpler one for narrow ones.

How do you keep GSAP scroll animation fast in Webflow?

Keep GSAP fast in Webflow by animating only transform and opacity, loading plugins only where they're used, and keeping the hero static. GSAP itself is efficient, but what you animate decides the cost. Moving an element with x, y or scale stays on the compositor, while animating width, height, margins or box shadows forces layout or paint on every frame.

  • Don't fade in the largest element. If the hero headline or image starts invisible, it can delay Largest Contentful Paint. web.dev defines a good LCP as 2.5 seconds or less.
  • Watch the main thread. Heavy scroll handlers and long setup scripts can make taps feel slow. web.dev defines a good Interaction to Next Paint as 200 milliseconds or less.
  • Scope plugins. If only the homepage uses SplitText, consider loading it from that page's settings instead of site-wide.
  • Test on a mid-range phone. A fast laptop hides jank that most of your visitors will feel.

The broader method for diagnosing scroll jank is in scroll animations without killing performance, and the Webflow-specific Core Web Vitals fixes are in Core Web Vitals for Framer, Webflow and Next.js. If you're tempted to add smooth scrolling on top of ScrollTrigger, read our take on Lenis smooth scroll first.

How do you respect reduced motion with GSAP in Webflow?

Respect reduced motion by wrapping your scroll animations in gsap.matchMedia() with a prefers-reduced-motion query, so visitors who ask for less motion get a static, fully readable page. GSAP's matchMedia reverts the animations and their ScrollTriggers automatically when the condition stops matching, which keeps the code short.

In practice, you create one matchMedia context with two conditions: one for no-preference, where the full animation runs, and one for reduce, where elements simply sit in their final state. Don't just shorten durations for reduced motion. Remove the movement and keep, at most, a quick opacity change. For the visual interactions panel, check Webflow's current documentation for how it handles the reduced-motion setting, and test it yourself by turning on reduce motion in your operating system.

One more guardrail: never hide content with CSS and rely on GSAP to reveal it. If the script fails or loads late, content set to opacity zero never appears, which hurts readers and crawlers alike. Set the hidden state from the script itself, with gsap.from() or a set call inside the same block.

When should you use GSAP code instead of Webflow interactions?

Use GSAP code when the animation depends on logic: measured values, conditions, CMS-driven counts or events from other scripts. The visual panel handles timelines, scroll triggers, pins and staggers well, and it keeps the motion editable by designers.

Pros

  • Handles calculated and conditional animation the panel can't express
  • One script can drive every CMS item the same way
  • Full access to GSAP's API, including matchMedia and callbacks
  • Easy to version and review if you keep it in a repository

Cons

  • Invisible in the Designer, so editors can't preview or change it
  • Breaks quietly when someone renames a class or restructures a section
  • Needs a developer for every change
  • Easy to duplicate if several pages each paste their own copy

If your Webflow site has grown into a pile of page-level scripts nobody owns, that's usually the sign to consolidate. Our Webflow development service includes cleaning up motion like this, and the trade-offs between GSAP and other libraries are covered in GSAP vs Motion vs CSS.

What happens to GSAP animations if you move off Webflow?

GSAP code moves well between platforms, but Webflow's visual interactions don't export as code, so plan to rebuild them. Custom scripts that target classes or attributes can usually be ported to a Next.js or plain HTML site with small changes. Interactions built in the panel live inside Webflow's project data.

If a migration is likely soon, keeping complex choreography in code makes it more portable. We cover what translates in Webflow interactions to Framer.

Frequently asked questions

Is GSAP free to use in Webflow?
Yes. GSAP's pricing page says the whole library, including plugins such as ScrollTrigger, SplitText and MorphSVG, is free for all users, supported by Webflow. Webflow's GSAP-powered interactions are also offered to all customers at no extra cost. Check GSAP's current terms of use for any licensing conditions that apply to your specific project.
Why doesn't my GSAP animation work in the Webflow Designer?
Custom code added in page or site settings doesn't run in the Designer canvas. Publish to your webflow.io staging domain and test there. Animations built with Webflow's own GSAP-powered interactions can be previewed in the Designer, which is one reason to build there first and keep custom code for the cases that need it.
Do I still need to add a GSAP CDN link in Webflow?
Usually not. The GSAP integration in site settings loads the core library and the plugins you tick across the whole site. Add your own script tag only if you want GSAP on a single page instead of site-wide, and then make sure no other page loads a second, different version.
Can I use GSAP with Webflow CMS collection items?
Yes. Give each collection item a shared class or data attribute, then select them all in your script and create one animation or ScrollTrigger per item in a loop. This keeps new CMS items animated automatically. Call ScrollTrigger.refresh() if items load or filter after the page renders, so trigger positions stay correct.
Does ScrollTrigger hurt SEO?
Not by itself. Search engines read the HTML, and ScrollTrigger only changes how elements move. Problems come from hiding content with CSS until a script reveals it, or from heavy scripts that slow the page. Keep content visible by default, set hidden states from the script, and keep the hero static.

· CEO & Design Director

Copywriter, designer and developer, and founder of Designify Studio. Over five years, 60+ projects across 14+ industries, for startups that have raised $300M+.

Want this done for you? Website, $8,000.

A multi-page marketing site, written and designed by us, developed in Next.js and animated. $8,000, one-time, up to 6 pages. Book a free 30-minute call to see if it fits.

Schedule Call