JavaScript SDK

One function. Zero dependencies.

The animation library that replaces GSAP. Scroll, hover, click, gesture — every trigger built in. Full TypeScript. Under 20KB gzipped.

Read the docs
API by example

See the code. Play the result.

Every example is live — click Play to see the SDK in action.

One Function API

One function. One config object. That's the entire API.

Motion() takes a name, a target, and a plain config object — from, to, duration, ease. No method chains, no class instances, no setup ceremony. The simplest animation API you've ever used.

Motion('pulse', '.shape', { from: { rotate: -30 }, to: { rotate: 30 }, duration: 0.8, ease: 'sine.inOut', repeat: 3, yoyo: true, }).play()
Stagger & Orchestration

Hundreds of elements. Cascade, wave, or randomize.

Stagger timing across any group — from center, edges, start, end, or random. Grid-aware stagger auto-detects your layout. At scale, Motion.page SDK triggers fewer browser recalcs and finishes faster than GSAP.

Motion('grid', '.block', { from: { opacity: 0, scale: 0 }, stagger: { each: 0.006, from: 'random' }, ease: 'back.out(1.4)', }).play()
Split Text

Split by chars, words, or lines — with one property.

Add split: "chars" to any animation and Motion.page handles the rest — DOM splitting, cleanup, accessibility. Combine with stagger and mask for cinematic text reveals.

Motion('headline', 'h1', { split: 'chars', from: { opacity: 0, y: 20 }, stagger: 0.03, ease: 'power3.out', }).play()

Animate Everything

DrawSVG

Animate SVG paths — draw, trace, and reveal.

drawSVG animates stroke-dashoffset to draw and erase SVG paths. Combine with stagger for sequential path tracing. Works with any SVG path — logos, illustrations, hand-drawn effects.

Motion('draw', '.path', { from: { drawSVG: '0% 0%' }, to: { drawSVG: '0% 100%' }, duration: 1.2, stagger: 0.2, }).play()
Composable triggers

8 trigger types, fully composable

Chain .onScroll(), .onHover(), .onClick() — mix scroll-driven parallax with hover interactions in a single animation. No extra plugins.

Scroll
.onScroll()
Hover
.onHover()
Click
.onClick()
Page Load
.onPageLoad()
Timeline
.play()
Gesture
.onGesture()
SVG
drawSVG
Split Text
split: chars
Developer experience

Built for modern stacks

ESM-first, tree-shakeable, fully typed. Works with React, Vue, Svelte, Astro, Next.js, and vanilla JS.

Zero Dependencies

No jQuery, no GSAP, no external runtime. The SDK is fully self-contained — just import and go.

import { Motion } from "@motion.page/sdk"
Full TypeScript

Complete type definitions for every property, easing, trigger, and callback. Autocomplete everything.

Motion<HTMLDivElement>(…)
Tree-shakeable

Import only what you use. ESM, IIFE, and CDN builds available. Works with every bundler and framework.

npm i @motion.page/sdk

Your next project
deserves better animations.