Viewmotion
On-scroll animations, zero dependencies
> The problem
The most popular scroll animation libraries come with heavy dependencies, are tied to specific frameworks, or require complex configurations for common use cases. For those who want smooth animations without compromising on bundle size and portability, options are limited.
- Existing libraries are heavy and framework-dependent
- Complex setup 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: a single HTML attribute or function call is all it takes. The project is structured as a pnpm monorepo with adapters for multiple 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, 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