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

@present-day/reveal-row

v0.1.6

Published

Horizontal scroll-to-reveal row for actions on the left, right, or both sides

Readme

@present-day/reveal-row

Horizontally scrollable row that reveals one or two action columns — right, left, or both sides. Three snap positions: left · center · right. Styling is entirely via classNames props (no bundled CSS). Scroll physics use inline style on the scroll track so the component works with zero external CSS.

Install

npm i @present-day/reveal-row

Peer dependencies: react, react-dom (v18 or v19).

Basic usage

import { RevealRow } from '@present-day/reveal-row'

// Right mode — swipe left to reveal
<RevealRow right={<button onClick={handleDelete}>Delete</button>}>
  <MyRowContent />
</RevealRow>

// Left mode — swipe right to reveal
<RevealRow left={<button onClick={handlePin}>Pin</button>}>
  <MyRowContent />
</RevealRow>

// Both modes — swipe either direction
<RevealRow
  left={<button onClick={handlePin}>Pin</button>}
  right={<button onClick={handleDelete}>Delete</button>}
>
  <MyRowContent />
</RevealRow>

Modes

| mode | Slots used | Resting ("closed") scroll | | ------- | -------------------- | ------------------------------------------- | | right | right only | scrollLeft = 0 (left edge) | | left | left only | scrollLeft = wL (after leading column) | | both | left and right | scrollLeft = wL (main fills viewport) |

Omit mode and it's inferred: both slots → both, only leftleft, otherwise right.

Props

| Prop | Type | Default | Description | | ---- | ---- | ------- | ----------- | | children | ReactNode | — | Primary row content | | left | ReactNode | — | Leading action column | | right | ReactNode | — | Trailing action column | | mode | 'left' \| 'right' \| 'both' | inferred | Override mode detection | | actionWidthLeft | number | 88 | Width (px) of the left column | | actionWidthRight | number | 88 | Width (px) of the right column | | classNames | RevealRowClassNames | {} | Class names for each sub-element | | showHandle | boolean | true | Render the default 6-dot drag affordance | | handle | ReactNode | — | Replace the default handle with custom content | | handlePosition | 'start' \| 'end' | 'start' in left mode, 'end' otherwise | Where the handle strip sits in the row | | handleTitle | string | 'Drag horizontally…' | Tooltip on the default handle | | handleAriaLabel | string | 'Drag horizontally…' | Screen-reader text on the default handle | | onRevealChange | (pos: RevealPosition) => void | — | Fires when the settled position changes (debounced) | | onScroll | UIEventHandler | — | Raw scroll events | | disabled | boolean | false | Disables swiping | | resetWhenDisabled | boolean | true | Snap closed when disabled becomes true | | isActive | boolean | false | Snap closed (e.g. another row was selected) | | className | string | — | Added to the root scroll element | | style | CSSProperties | — | Added to the root scroll element |

Ref API

const ref = useRef<RevealRowHandle>(null)

<RevealRow ref={ref} right={<DeleteButton />}>
  <MyRowContent />
</RevealRow>

// Programmatic control
ref.current?.close()                    // snap to center
ref.current?.reveal('left')            // snap to left action
ref.current?.reveal('right')           // snap to right action
ref.current?.reveal('center')          // alias for close

classNames

All sub-elements accept class names for styling:

<RevealRow
  classNames={{
    root: 'my-row',          // scroll container
    main: 'my-row__main',    // main content track
    mainInner: '',           // flex wrapper inside main
    left: 'my-row__left',   // left action column
    right: 'my-row__right', // right action column
    handleContainer: '',    // outer handle strip
    handleIcon: '',         // icon wrapper inside handle
  }}
>

Integration notes

Nested vertical scroll — the root uses touch-action: pan-x pan-y so a parent list can still scroll vertically.

Overscroll / browser back gestures — if horizontal swipes compete with iOS back or macOS trackpad history navigation, set overscroll-behavior-x: none on a suitable ancestor (e.g. a full-screen container).

Preventing row activation on swipe — the component guards against triggering a click after a horizontal drag. If you wrap the row in a command palette item or similar, keep the built-in onClickCapture behaviour intact, or replicate it.

Publishing

Run bun run build to produce dist/. The exports field in package.json points to dist/index.{js,mjs,d.ts}. Push a tag to trigger the GitHub Actions publish workflow (OIDC trusted publishing — no npm token needed in secrets).