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

@snapdeck/core

v0.1.3

Published

Snapdeck core: framework-agnostic section-snap scroll engine.

Readme

@snapdeck/core

Framework-agnostic section-snap scroll engine. Tiny, typed, zero runtime deps. MIT.

Snapdeck gives you one-page, section-snapping vertical scroll (with optional horizontal sub-slides) built on the modern web platform: Web Animations API, Pointer Events, IntersectionObserver, ResizeObserver, matchMedia. No jQuery, no polyfills, no hidden runtime.

Install

npm install @snapdeck/core
# or
pnpm add @snapdeck/core
# or
yarn add @snapdeck/core

Import the stylesheet once from your app entry:

import '@snapdeck/core/css';

Minimal usage

<div id="deck">
  <section data-snapdeck-section data-anchor="intro">…</section>
  <section data-snapdeck-section data-anchor="features">…</section>
  <section data-snapdeck-section data-anchor="pricing">…</section>
</div>
import snapdeck from '@snapdeck/core';
import '@snapdeck/core/css';

const deck = snapdeck('#deck', {
  scrollingSpeed: 700,
  easing: 'cubic-bezier(0.2, 0.7, 0.2, 1)',
});

deck.on('afterLoad', ({ destination }) => {
  console.log('now on section', destination.index, destination.anchor);
});

deck.moveTo('features');     // by anchor
deck.moveTo(2);              // by index
deck.moveSectionDown();      // relative

Framework wrappers

| Package | Install | | --- | --- | | React | npm i @snapdeck/react @snapdeck/core | | Vue 3 | npm i @snapdeck/vue @snapdeck/core | | Angular (standalone) | npm i @snapdeck/angular @snapdeck/core |

Plugins (opt-in, tree-shakable)

| Package | What it does | | --- | --- | | @snapdeck/plugin-nav-dots | Right/left-edge dot nav with aria-current. | | @snapdeck/plugin-progress-bar | Top/bottom reading-progress bar via CSS custom properties. | | @snapdeck/plugin-lazy-media | Transfers data-srcsrc for active + adjacent sections. | | @snapdeck/plugin-observer | Narrow MutationObserver that calls refresh() on content changes. |

import snapdeck from '@snapdeck/core';
import { navDots } from '@snapdeck/plugin-nav-dots';
import { progressBar } from '@snapdeck/plugin-progress-bar';

const deck = snapdeck('#deck', {
  plugins: [navDots(), progressBar({ position: 'top' })],
});

Migrating from fullpage.js v4

Drop-in shim, no code changes, just a dependency swap:

npm uninstall fullpage.js
npm install @snapdeck/v4-compat @snapdeck/core
import fullpage from '@snapdeck/v4-compat';

const fp = fullpage('#fullpage', {
  sectionsColor: ['#fff', '#eee', '#ddd'],
  anchors: ['first', 'second', 'third'],
  afterLoad: (origin, destination, direction) => { /* ... */ },
});

Core API

interface SnapdeckInstance {
  getState(): SnapdeckState;
  moveTo(target: number | string, opts?: { immediate?: boolean }): Promise<void>;
  moveSectionUp(): Promise<void>;
  moveSectionDown(): Promise<void>;
  moveSlideLeft(): Promise<void>;
  moveSlideRight(): Promise<void>;
  silentMoveTo(target: number | string): void;
  refresh(): void;
  setOption<K>(key: K, value: unknown): void;
  getOption<K>(key: K): unknown;
  on(event, handler): () => void;
  destroy(): void;
}

Events: beforeLeave, onLeave, afterLoad, afterRender, afterResize, afterResponsive, afterRebuild, beforeSlideLeave, onSlideLeave, afterSlideLoad. Return false from beforeLeave / onLeave to cancel a navigation.

Full reference: chinmayshringi.github.io/snapdeck/docs.

Architecture invariants

  • Immutable state; reducers return new refs on mutations.
  • Typed event bus; instance-scoped and error-isolated.
  • Single-slot command queue, new nav cancels any in-flight animation cleanly.
  • WAAPI scroll engine; prefers-reduced-motion takes a synchronous fast path.
  • Wheel input time-debounced; touch uses Pointer Events only.
  • Instance-per-container (no globals). Two Snapdecks on one page work independently.
  • SSR-safe, mount effects run only on the client.

License & origin

MIT. Snapdeck is an independent clean-room implementation, no code or documentation derived from alvarotrigo/fullpage.js or any other GPL scroll library.