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

@stambha/pagination

v1.1.1

Published

Components V2 pagination (prev/next/dismiss) for Stambha Signals

Readme

@stambha/pagination

Components V2 pagination with prev / next / dismiss — built on Stambha Signals (stambha: custom ids).

Default layout: IS_COMPONENTS_V2 + Container + Text Display + button row (same builders as @stambha/core). Classic embeds are converted to markdown. Use variant: "classic" only if you must keep Discord embeds.

Part of Stambha plugins · requires @stambha/core ^1.3.0 (Components V2 builders)


Install

pnpm add @stambha/pagination@^1.1.1 @stambha/core@^1.3.0

Requires Node.js 20+.


Quick start

Register the signal once (loader or manual register), then create a paginator from a command:

// src/signals/PaginationSignal.ts
export { PaginationSignal } from "@stambha/pagination";
import { Command, type CommandContext, ok, type Registry } from "@stambha/core";
import { createPaginator } from "@stambha/pagination";

export class HelpPagesCommand extends Command {
  constructor(registry: Registry<Command>) {
    super(registry, {
      name: "pages",
      description: "Show multi-page help (Components V2)",
      kinds: ["slash", "prefix"],
    });
  }

  async execute(ctx: CommandContext) {
    const paginator = await createPaginator({
      userId: ctx.userId,
      accentColor: 0x5865f2,
      pages: [
        { content: "# Getting started\n\nInstall `@stambha/core`…" },
        { content: "# Commands\n\nUse slash or prefix…" },
        {
          // embeds still work — converted to markdown under V2
          embeds: [{ title: "Deployment", description: "Tier-split when you outgrow one process." }],
        },
      ],
    });

    await ctx.reply(paginator.message());
    return ok(undefined);
  }
}

Ensure attachStambhaClient(hub, client, { signals: true }) (default) so button clicks route to PaginationSignal.

Custom ids look like:

stambha:pagination:next:<sessionId>

Key exports

| Export | Purpose | |--------|---------| | createPaginator | Create a session and build the initial ReplyPayload | | PaginationSignal | Handles prev / next / dismiss clicks | | Page, PaginatorOptions, PaginatorVariant | Types | | buildPagePayload / buildClassicPagePayload | Manual payload builders |

Options

| Option | Default | Notes | |--------|---------|--------| | pages | required | Array or async resolver | | variant | "v2" | "classic" keeps content/embeds + Action Row | | accentColor | unset | V2 container accent (0xRRGGBB) | | showPageCount | true | V2 footer Page i / n | | userId | unset | Lock controls to the invoker | | timeoutMs | 300000 | Session TTL (5 minutes) | | wrap | false | Cycle at ends; otherwise disable prev/next | | labels | Prev / Next / Dismiss | Button labels | | startAt | 0 | Initial page index |

Page shape

| Field | V2 | Classic | |-------|----|---------| | content | Text Display | content | | displays | Extra Text Displays | ignored | | embeds | Converted to markdown | top-level embeds |

Page turns prefer Discord UPDATE_MESSAGE (interaction callback type 7) when client.restPort is set. Otherwise they fall back to SignalContext.reply.


Related packages

| Package | Role | |---------|------| | @stambha/core | Signals, Components V2 builders, client | | @stambha/gateway | attachStambhaClient routing |


Development

pnpm --filter @stambha/pagination build
pnpm --filter @stambha/pagination test