Viewmotion
On-scroll animations, zero dependencies
> The problem
The most popular scroll animation libraries bring heavy dependencies, are tied to specific frameworks, or require complex configuration for common use cases. For those wanting smooth animations without compromising bundle size and portability, options are limited.
- Existing libraries heavy and framework-dependent
- Complex configuration for common animations
- Negative impact on bundle size and performance
> The solution
I created Viewmotion, a zero-dependency npm library that uses the native Intersection Observer API to trigger scroll animations. The API is declarative and minimal: just an HTML attribute or a single call to activate animations. The project is structured as a pnpm monorepo with adapters for different frameworks and an Astro documentation site.
- Zero dependencies, built on Intersection Observer API
- Declarative API with HTML attributes or single call
- pnpm monorepo with multi-framework adapters
- Astro documentation site
> The result
A lightweight and portable library, usable in any web project with a single import. Animations are smooth, performant, and don't impact bundle size. The monorepo ensures consistent support across multiple frameworks.
- Bundle size under 3KB gzipped
- Compatible with any framework or vanilla JS
- Interactive documentation with live examples
> Features
- Declarative scroll-triggered animations
- Zero external dependencies
- Framework-agnostic with dedicated adapters
- Minimal and intuitive API
- Native performance with Intersection Observer
- Interactive documentation