GSAP README

The project's README from github.com/greensock/GSAP. As one markdown file: README.md.

GSAP (GreenSock Animation Platform)

GSAP - Animate anything

GSAP is a framework-agnostic JavaScript animation library that turns developers into animation superheroes. Build high-performance animations that work in every major browser. Animate CSS, SVG, canvas, React, Vue, WebGL, colors, strings, motion paths, generic objects... anything JavaScript can touch! GSAP's ScrollTrigger plugin delivers jaw-dropping scroll-based animations with minimal code. gsap.matchMedia() makes building responsive, accessibility-friendly animations a breeze.

No other library delivers such advanced sequencing, reliability, and tight control while solving real-world problems on over 12 million sites. GSAP works around countless browser inconsistencies; your animations just work. At its core, GSAP is a high-speed property manipulator, updating values over time with extreme accuracy. It's up to 20x faster than jQuery!

GSAP is completely flexible; sprinkle it wherever you want. Zero dependencies.

There are many optional plugins and easing functions for achieving advanced effects easily like scrolling, morphing, text splitting, animating along a motion path or FLIP animations. There's even a handy Observer for normalizing event detection across browsers/devices.

Get Started

Get Started with GSAP

Docs & Installation

View the full documentation here, including an installation guide.

CDN

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>

See JSDelivr's dedicated GSAP page for quick CDN links to the core files/plugins. There are more installation instructions at gsap.com.

Every major ad network excludes GSAP from file size calculations and most have it on their own CDNs, so contact them for the appropriate URL(s).

NPM

See the guide to using GSAP via NPM here.

npm install gsap

GSAP's core can animate almost anything including CSS and attributes, plus it includes all of the utility methods like interpolate(), mapRange(), most of the eases, and it can do snapping and modifiers.

// typical import
import gsap from "gsap";

// get other plugins:
import ScrollTrigger from "gsap/ScrollTrigger";
import Flip from "gsap/Flip";
import Draggable from "gsap/Draggable";

// or all tools are exported from the "all" file (excluding members-only plugins):
import { gsap, ScrollTrigger, Draggable, MotionPathPlugin } from "gsap/all";

// don't forget to register plugins
gsap.registerPlugin(ScrollTrigger, Draggable, Flip, MotionPathPlugin); 

The NPM files are ES modules, but there's also a /dist/ directory with UMD files for extra compatibility.

GSAP is FREE!

Thanks to Webflow, GSAP is now 100% FREE including ALL of the bonus plugins like SplitText, MorphSVG, and all the others that were exclusively available to Club GSAP members. That's right - the entire GSAP toolset is FREE, even for commercial use! 🤯 Read more here

ScrollTrigger & ScrollSmoother

If you're looking for scroll-driven animations, GSAP's ScrollTrigger plugin is the standard. There's a companion ScrollSmoother as well.

ScrollTrigger

Using React?

There's a @gsap/react package that exposes a useGSAP() hook which is a drop-in replacement for useEffect()/useLayoutEffect(), automating cleanup tasks. Please read the React guide for details.

Resources

Need help?

Ask in the friendly GSAP forums. Or share your knowledge and help someone else - it's a great way to sharpen your skills! Report any bugs there too (or file an issue here if you prefer).

License

GreenSock's standard "no charge" license can be viewed at https://gsap.com/standard-license.

Copyright (c) 2008-2026, GreenSock. All rights reserved.

GSAP (greensock/GSAP)

Searching Database…

29.4K ·GitHub
这是做什么的?GSAP(GreenSock Animation Platform)是一个不依赖任何框架的 JavaScript 库,用来制作高性能动画,兼容所有主流浏览器。
它是不是绑定了 React 这类框架,还是随便什么项目都能用?它是一个库,不是框架,也不依赖任何框架:无论纯 JS、React、Vue,还是 canvas/WebGL 项目,都能直接嵌入,不会接管你现有的技术栈。
怎么把它加到项目里?可以从 CDN 引入(gsap.com 上有核心文件和插件对应的快捷链接),也可以用 npm 安装。
它主要用来做广告,还是普通网页应用也能用?它是面向现代网页开发的通用库;动画广告只是它特别受欢迎的一个领域而已。
它是免费的吗,还是用到一定程度要收费?在 GreenSock 的标准“免费”许可下可以免费使用;版权仍归 GreenSock 所有,所以许可条款是它自己定的,而不是 MIT 那样的开源许可证。
为什么 README 里专门提到广告网络?因为各大广告网络在计算文件体积时都不把 GSAP 算在内,而且大多数广告网络还会把它托管在自己的 CDN 上,所以这个库的体积不会计入广告的重量限制。
这个项目成熟吗?历史悠久、使用广泛:仓库从 2012 年就有了,GitHub 上大约有 29,000 颗星,版权声明一直延续到 2026 年。
只用核心部分就够了吗,还是还得装插件?核心部分几乎能对任何东西做动画,包括 CSS 和属性,但 GSAP 也提供了单独的插件文件,可以从 CDN 引入。
Creator
greensock
Size
14.1 MB
Stars
29.4K
Updated
CommitApr 13
Age
14y
Commits · 90 Days