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

@love-rox/ptpt-core

v0.1.1

Published

Split-flap display library for the web. Framework-agnostic core.

Readme

@love-rox/ptpt-core

Framework-agnostic split-flap (patapata / Solari / Vestaboard-style) display for the web. Zero dependencies, ESM only, ships its own types.

The point of a split-flap is the wait — the analog ticking as flaps turn. ptpt keeps that feel while staying a thin DOM layer over pure functions.

Install

bun add @love-rox/ptpt-core
# or: npm i @love-rox/ptpt-core

Minimal example

import { createCell, createBoard } from '@love-rox/ptpt-core'
import { digitsPreset } from '@love-rox/ptpt-core/presets/digits'
import '@love-rox/ptpt-core/styles.css' // optional default look

const root = document.getElementById('counter')!
const cells = Array.from({ length: 3 }, () => {
  const el = document.createElement('div')
  root.appendChild(el)
  return createCell(el, { preset: digitsPreset })
})

const board = createBoard(cells)
await board.flipTo('042') // string sugar → ['0', '4', '2']

A single cell, imperatively:

const cell = createCell(el, { preset: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ ' })
await cell.flipTo('Z') // resolves once the flaps settle on Z

Frames

A cell flips through frames. Strings are normalized to text frames; images and elements are explicit.

import { text, image, element } from '@love-rox/ptpt-core'

createCell(el, {
  frames: [
    'A', // text, slug = 'A'
    text('a-red', 'A'), // same glyph, distinct slug
    image('sun', '/sun.svg', { alt: '太陽' }),
    element('clock', myNode), // cloned into the cell
  ],
})

preset and frames are mutually exclusive; with neither, the default preset (blank + A–Z + 0–9 + symbols) is used.

Boards

createBoard(cells, options) flips cells together and manages one role="status" live region (announcing only the settled result).

import { createBoard } from '@love-rox/ptpt-core'
import { wave } from '@love-rox/ptpt-core/delays/wave'

const board = createBoard(cells, {
  delayFn: wave({ direction: 'ltr', step: 50 }), // staggered sweep
  announceTiming: 'after', // when to update aria-label
})

board.flipTo(['H', 'I', null, 'sun']) // null leaves a cell unchanged

Presets & delays

Both are available as a convenience object and as tree-shakable subpaths.

import { presets, delays } from '@love-rox/ptpt-core'
presets.digits // { name, chars, description, ... }
delays.random(300)

// tree-shakable:
import { alphaPreset } from '@love-rox/ptpt-core/presets/alpha'
import { uniform } from '@love-rox/ptpt-core/delays/uniform'

Built-in presets: default, alphanumeric, digits, alpha. Built-in delays: uniform(), random(maxMs), wave({ direction, step }).

Styling

Importing @love-rox/ptpt-core/styles.css gives a working dark look. Everything is themeable via custom properties on .ptpt-cell:

.ptpt-cell {
  --ptpt-width: 48px;
  --ptpt-height: 72px;
  --ptpt-flip-duration: 200ms;
  --ptpt-color: #f0e8d0;
  --ptpt-flap-bg: #2a2a2a;
}

For a fully headless setup, skip the stylesheet and target the classes yourself: .ptpt-cell, .ptpt-half, .ptpt-top, .ptpt-top-preview, .ptpt-bottom, .glyph (plus .ptpt-cell.flipping during a flip and .ptpt-board on the live region).

Accessibility

  • The board is a role="status" aria-live="polite" region; cells are aria-hidden so mid-flip states aren't announced.
  • aria-label aggregates the cells' frames (text value / image alt, falling back to slug). Override with ariaLabelFormatter.
  • reducedMotion ('instant' default, 'minimal', 'ignore') is honored automatically when the OS prefers reduced motion.

License

MIT