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

@trellisjs/plugin-pagination

v3.0.0

Published

Trellis 分頁插件 — 基本頁碼導航

Downloads

452

Readme

@trellisjs/plugin-pagination

Page navigation plugin for Trellis data tables with configurable page size.

Installation

npm install @trellisjs/plugin-pagination

Events

Listens

| Event | Payload | Description | |---|---|---| | pagination:goto | { page: number } | Jump to a specific page. Clamped to the valid range [1, totalPages]. | | pagination:prev | (none) | Go to the previous page. No-op when already on page 1. | | pagination:next | (none) | Go to the next page. No-op when already on the last page. | | pagination:pageSize | { pageSize: number } | Change the number of rows per page. Resets to page 1. |

State Updated

The plugin writes the following on every navigation:

  • state.pagination -- { page, pageSize, totalItems }.
  • state.data -- the sliced rows for the current page.

Usage

import { createTrellis } from '@trellisjs/core';
import { createPaginationPlugin } from '@trellisjs/plugin-pagination';

const api = createTrellis({
  columns: [{ id: 'name', accessor: 'name' }],
  data: [/* ... 100 rows ... */],
  plugins: [createPaginationPlugin()],
});

// Go to page 3
api.emit('pagination:goto', { page: 3 });

// Next page
api.emit('pagination:next', {});

// Previous page
api.emit('pagination:prev', {});

// Change page size to 25 rows per page (resets to page 1)
api.emit('pagination:pageSize', { pageSize: 25 });

Upstream Reactivity

The plugin subscribes to state changes from upstream plugins (e.g. sort, filter). When the data array is replaced by another plugin, pagination automatically resets to page 1 and re-slices the new dataset.

Plugin Order

Install the pagination plugin after filter and sort plugins so it paginates the already-transformed data:

plugins: [createSortPlugin(), createFilterPlugin(), createPaginationPlugin()]

License

MIT