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

@voltilt/coverflow

v0.2.0

Published

Finger-follow 3D card coverflow — vanilla JS + CSS 3D

Readme

@voltilt/coverflow

Finger-follow 3D card coverflow — vanilla JS + CSS perspective. Drag, wheel, and keyboard.

Install

npm install @voltilt/coverflow
import { createCoverflow } from '@voltilt/coverflow';
import '@voltilt/coverflow/style.css';

CDN (jsDelivr)

Package page · pin a version in production:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@voltilt/[email protected]/src/style.css" />
<script type="module">
  import { createCoverflow } from 'https://cdn.jsdelivr.net/npm/@voltilt/[email protected]/+esm';
</script>

Markup

Use a root with data-vt-* hooks (or pass elements refs):

<div class="vt-coverflow" id="demo" data-vt-viewport>
  <div class="vt-coverflow-ambient" aria-hidden="true"></div>
  <div class="vt-coverflow-wrap" data-vt-wrap>
    <div class="vt-coverflow-scene" data-vt-scene></div>
  </div>
  <div class="vt-coverflow-chrome" data-vt-chrome>
    <button type="button" class="vt-nav" data-vt-prev aria-label="Previous">‹</button>
    <div class="vt-coverflow-status">
      <span data-vt-label class="vt-coverflow-label"></span>
      <span data-vt-meta class="vt-coverflow-meta"></span>
    </div>
    <button type="button" class="vt-nav" data-vt-next aria-label="Next">›</button>
  </div>
  <div class="vt-empty vt-hidden" data-vt-empty><p></p></div>
</div>

Quick start

const flow = createCoverflow({
  root: document.querySelector('#demo'),
  titleOf: (item) => item.title,
  metaOf: (item) => item.role, // optional
  buildCard(item, { onActivate, isSuppressed, clearSuppress }) {
    const card = document.createElement('div');
    card.className = 'vt-card';
    card.innerHTML = `
      <div class="vt-card-face"></div>
      <div class="vt-card-body">
        <h3>${item.title}</h3>
        <a class="vt-card-open-hint" href="/people/${item.id}">Open</a>
      </div>
    `;
    card.addEventListener('click', (e) => {
      // Let real links / buttons work on their own
      if (e.target.closest('a[href], button, [data-vt-nodrag]')) return;
      if (isSuppressed()) { clearSuppress(); return; }
      onActivate(item);
    });
    return card;
  },
});

flow.on('change', ({ index, item }) => {
  console.log('focused', index, item);
});

flow.on('open', ({ item }) => {
  console.log('opened', item);
});

flow.bind();
flow.render(items);

Items need a stable id.

Events

Subscribe with flow.on(name, handler). Handlers receive a plain object. flow.off(name, handler) removes a listener. on() also returns an unsubscribe function.

| Event | When | Detail | |-------|------|--------| | change | Focused index changes (also once after each render) | { index, item, previousIndex } | | open | Card opened (Enter, openFocused(), or activate while focused) | { index, item } | | dragstart | Drag moved past the threshold | { index, item } | | drag | Drag position updated (animation-frame throttled) | { index, item, dx } | | dragend | Pointer released | { index, item, dx, steps, moved } |

You can also pass one-shot option callbacks: onChange, onOpen, onDragStart, onDrag, onDragEnd. The older openItem(item) option still runs when a card is opened.

flow.on('change', ({ index, item }) => { /* … */ });
const stop = flow.on('open', ({ item }) => { /* … */ });
stop(); // or flow.off('open', handler)

Interactive content inside cards

Drag and links can coexist. Coverflow does not start a drag when the pointer goes down on:

  • chrome (.vt-coverflow-chrome / [data-vt-chrome])
  • links, buttons, inputs, and other controls inside a card
  • anything matching [data-vt-nodrag]
  • anything matching your extra ignoreSelector

Practical rules:

  1. Prefer a <div class="vt-card"> when the card contains links or controls (a root <button> cannot legally wrap an <a>).
  2. Put real <a href="…"> (or buttons) in the card — clicks on them will navigate / run as usual.
  3. On the card’s own click handler, ignore clicks that came from those controls (see the quick-start example).
  4. After a drag, coverflow briefly suppresses the following click so a swipe does not accidentally “open” the card — use isSuppressed() / clearSuppress() from buildCard helpers.

API

const flow = createCoverflow({ /* options */ });

flow.bind();
flow.render(items, { preferId: 2 });
flow.step(1);
flow.setActive(10);
flow.focusItemId(3);
flow.openFocused();
flow.on('change', handler);
flow.off('change', handler);
flow.destroy();

flow.activeIndex; // number
flow.activeItem;  // object | null
flow.deck;        // current filtered list

Theming

Override CSS variables on .vt-coverflow:

.vt-coverflow {
  --vt-accent: #ff7a59;
  --vt-bg: #120c0a;
}

License

MIT · KohlerCode