viewmotion

Introduction

viewmotion is a minimal reveal animation system for landing pages. It uses a single IntersectionObserver and CSS @keyframes to animate elements as they enter the viewport.

Framework-agnostic SSR-safe Zero dependencies < 2 KB gzipped

What it is

viewmotion observes elements entering the viewport and applies a CSS class that triggers a smooth animation. It solves one problem well: revealing elements on scroll with performant, composable CSS animations.

This is not a scroll-driven animation engine. There’s no timeline, no spring physics, no animation orchestration. Just battle-tested browser APIs assembled into a clean, minimal package.

Packages

The ecosystem is organized as a monorepo with a core library and framework-specific adapters:

PackageDescriptionVersion
viewmotionCore library — framework-agnostic0.1.1
viewmotion-reactReact adapter — useMotion hook0.1.1
viewmotion-vueVue adapter — v-motion directive + useMotion composable0.1.1
viewmotion-svelteSvelte adapter — use:motion action0.1.1

Key features

  • Single IntersectionObserver — one global observer for all animated elements
  • 8 built-in presets — from subtle fades to directional slides and blurs
  • Stagger support — cascade child animations with automatic delay offsets
  • Accessibility — respects prefers-reduced-motion out of the box
  • Smooth scroll — optional Lenis integration as a peer dependency
  • Extensible — register custom presets with registerPreset()

Where to start

GoalPath
Animate something in 5 minutesQuick startPresets
Understand how it worksHow it worksAPI reference
Using React / Vue / Svelte / AstroFramework adapters

Compared to alternatives

LibrarySize (gzip)Scroll revealSSR-safeNo JS runtimeFramework-specific
viewmotion~2 KB✅ built-in✅ CSS only❌ adapters available
AOS~14 KB✅ core use-case⚠️ partial
GSAP ScrollTrigger~100 KB✅ powerful
Framer Motion~45 KB✅ variants✅ React only
Motion One~18 KB

Choose viewmotion if: you want scroll-reveal animations that ship zero runtime overhead, work everywhere, and won’t bloat your bundle. It’s not for complex timelines or physics-based animations.