GSAP/gsap-utils — Agent Skills | officialskills.sh

Setup & Installation

npx skills add https://github.com/greensock/gsap-skills --skill gsap-utils
or paste the link and ask your coding assistant to install it
https://github.com/greensock/gsap-skills/tree/main/skills/gsap-utils
View on GitHub

What This Skill Does

gsap.utils is a collection of math and collection helpers built into GSAP. It covers clamping, range mapping, normalization, interpolation, random values, snapping, wrapping, array conversion, and function composition. All utilities work standalone or return reusable functions when the value argument is omitted.

Using gsap.utils keeps math and collection operations in sync with GSAP's internal value handling, so there are no unit mismatches or off-by-one errors that come from rolling your own clamp or lerp functions.

When to use it

  • Mapping scroll position to a rotation value with mapRange
  • Snapping draggable elements to a CSS grid using snap
  • Generating random x/y offsets for staggered particle animations
  • Scoping element selectors to a React component container with selector()
  • Composing normalize, mapRange, and snap into a single pipeline for input handling