npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rune-scroller

v2.2.2

Published

Lightweight, high-performance scroll animations for Svelte 5. 14KB gzipped, zero dependencies.

Readme

⚡ Rune Scroller

Lightweight scroll animations for Svelte 5 — Built with Svelte 5 Runes and IntersectionObserver API.

🚀 Open Source by ludoloops at LeLab.dev 📜 Licensed under MIT


✨ Features

  • 5.7KB gzipped (JS+CSS) - Minimal overhead
  • Zero dependencies - Pure Svelte 5 + IntersectionObserver
  • 14 animations - Fade, Zoom, Flip, Slide, Bounce
  • TypeScript support - Full type definitions
  • SSR-ready - SvelteKit compatible
  • GPU-accelerated - Pure CSS transforms
  • Accessible - Respects prefers-reduced-motion

📦 Installation

npm install rune-scroller

🚀 Quick Start

<script>
	import runeScroller from 'rune-scroller';
</script>

<!-- Simple animation -->
<div use:runeScroller={{ animation: 'fade-in' }}>
	<h2>Animated Heading</h2>
</div>

<!-- With custom duration -->
<div use:runeScroller={{ animation: 'fade-in-up', duration: 1500 }}>
	<div class="card">Smooth fade and slide</div>
</div>

<!-- Repeat on every scroll -->
<div use:runeScroller={{ animation: 'bounce-in', repeat: true }}>
	<button>Bounces on every scroll</button>
</div>

🎨 Available Animations

Fade (5)

  • fade-in - Simple opacity fade
  • fade-in-up - Fade + move up 300px
  • fade-in-down - Fade + move down 300px
  • fade-in-left - Fade + move from right 300px
  • fade-in-right - Fade + move from left 300px

Zoom (5)

  • zoom-in - Scale from 0.3 to 1
  • zoom-out - Scale from 2 to 1
  • zoom-in-up - Zoom (0.5→1) + move up 300px
  • zoom-in-left - Zoom (0.5→1) + move from right 300px
  • zoom-in-right - Zoom (0.5→1) + move from left 300px

Others (4)

  • flip - 3D flip on Y-axis
  • flip-x - 3D flip on X-axis
  • slide-rotate - Slide + rotate 10°
  • bounce-in - Bouncy entrance (spring effect)

⚙️ Options

interface RuneScrollerOptions {
  animation?: AnimationType // Animation name (default: 'fade-in')
  duration?: number // Duration in ms (default: 800)
  repeat?: boolean // Repeat on scroll (default: false)
  debug?: boolean // Show sentinel as visible line (default: false)
  offset?: number // Sentinel offset in px (default: 0, negative = earlier)
  onVisible?: (element: HTMLElement) => void // Callback when visible
  sentinelColor?: string // Debug sentinel color (e.g. '#ff6b6b')
  sentinelId?: string // Custom sentinel ID
}

Examples

<!-- Basic -->
<div use:runeScroller={{ animation: 'zoom-in' }}>Content</div>

<!-- Custom duration -->
<div use:runeScroller={{ animation: 'fade-in-up', duration: 1000 }}>Fast</div>

<!-- Repeat mode -->
<div use:runeScroller={{ animation: 'bounce-in', repeat: true }}>Repeats</div>

<!-- Debug mode -->
<div use:runeScroller={{ animation: 'fade-in', debug: true }}>Debug</div>

<!-- Trigger earlier with negative offset -->
<div use:runeScroller={{ animation: 'fade-in-up', offset: -200 }}>
	Triggers 200px before element bottom
</div>

<!-- onVisible callback for analytics -->
<div use:runeScroller={{
	animation: 'fade-in-up',
	onVisible: (el) => {
		window.gtag?.('event', 'section_viewed', { id: el.id });
	}
}}>
	Tracked section
</div>

🎯 How It Works

Sentinel-based triggering:

  1. Invisible 1px sentinel created below your element
  2. When sentinel enters viewport, animation triggers
  3. Uses native IntersectionObserver for performance
  4. Pure CSS animations (GPU-accelerated)
  5. ResizeObserver auto-repositions sentinel

Why sentinels?

  • Accurate timing across all screen sizes
  • No complex offset calculations
  • Works with animated elements (transforms don't affect observer)

🌐 SSR Compatibility

Works seamlessly with SvelteKit:

<!-- src/routes/+layout.svelte -->
<script>
	import runeScroller from 'rune-scroller';
	let { children } = $props();
</script>

{@render children()}

♿ Accessibility

Respects prefers-reduced-motion:

@media (prefers-reduced-motion: reduce) {
  .scroll-animate {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

📚 API Reference

// Default export
import runeScroller from "rune-scroller"

// Named exports
import {
  useIntersection, // Composable
  useIntersectionOnce, // Composable
  calculateRootMargin, // Utility
} from "rune-scroller"

// Types
import type { AnimationType, RuneScrollerOptions } from "rune-scroller"

📖 Examples

Staggered Animations

<script>
	import runeScroller from 'rune-scroller';
	const items = ['Item 1', 'Item 2', 'Item 3'];
</script>

{#each items as item, i}
	<div use:runeScroller={{
		animation: 'fade-in-up',
		duration: 800,
		style: `--delay: ${i * 100}ms`
	}}>
		{item}
	</div>
{/each}

Hero Section

<h1 use:runeScroller={{ animation: 'fade-in-down', duration: 1000 }}>Welcome</h1>
<p use:runeScroller={{ animation: 'fade-in-up', duration: 1200 }}>Subtitle</p>
<button use:runeScroller={{ animation: 'zoom-in', duration: 800 }}>Get Started</button>

🔗 Links


📄 License

MIT © ludoloops


Made with ❤️ by LeLab.dev