Skip to content
Motion Engine

CSS does the work. JS only when needed.

40+ hooks. Zero dependencies. CSS transitions handle 90% of animations. JS only steps in for physics and gestures.

THREE LEVELS

01

Zero Config

useSimplePageMotion('home') — pass a page type, get a full preset. Hero, title, description, CTA — all animated. One line.

02

Config Object

usePageMotions({ hero: { type: 'hero' }, button: { type: 'button', hover: true } }) — map elements to motion types. One observer per page.

03

Full Control

useFadeIn, useSlideUp, useSpringMotion, useGesture — individual hooks that return { ref, style }. Compose freely.

DESIGN PRINCIPLES

CSS-First

CSS transitions run on the GPU compositor, off the main thread. React re-renders once — the browser handles the rest. JS only steps in where CSS can't go: spring physics and real-time gestures.

No External Dependencies

Only react and react-dom as peers. sideEffects: false for full tree-shaking — unused code stays out of your bundle.

40+ Hooks

Entrance, scroll, physics, gesture, interaction, orchestration, looping. Each returns { ref, style } — compose without wrapper components.

Real Spring Physics

useSpringMotion implements Hooke's Law from scratch. Mass, stiffness, damping — real physics, not CSS cubic-bezier approximation.

Performance Built-in

Layer management caps GPU layers at 100. PerformanceOptimizer tracks FPS and memory. useReducedMotion for accessibility.

VS FRAMER MOTION

Feature
Framer Motion
HUA motion-core
Bundle
~45KB gzipped
Tree-shakeable, zero deps
Animation engine
JS rAF every frame
CSS transitions (primary)
API style
Component-first
Hook-first
Spring physics
Popmotion (battle-tested)
Hooke's Law (from scratch)
Layout animations
FLIP, LayoutGroup
useLayoutMotion + flip/morph/cube
Exit animations
AnimatePresence
TransitionEffects reverse
Scroll-driven
useScroll + useTransform
useScrollProgress + useElementProgress
Gestures
Drag, tap, hover
Swipe, pinch, rotate, pan, long press
Dependencies
Multiple internal
Zero
React version
16+
19+

Feel the difference

Back to HUA Framework