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

@typepurify/react-table

v0.5.11

Published

Universal, zero-dependency Data Table.

Readme


npm version

🚀 Overview

@typepurify/react-table provides highly optimized hooks for rendering and managing massive data tables in React without relying on heavy DOM-bound libraries.

📦 Installation

npm install @typepurify/react-table

🛠 Features & Usage

1. useTable

The core engine for your tables. Supports Multi-sorting, Search, Pagination, Column Visiblity, and native CSV Export.

import { useTable } from '@typepurify/react-table';

const data = [
  { id: 1, name: 'Alice' },
  { id: 2, name: 'Bob' },
];

function MyTable() {
  const {
    paginatedData,
    visibleColumns,
    handleSort,
    setSearchQuery,
    exportToCsv,
    currentPage,
    totalPages,
    setCurrentPage,
    clearSort, // v0.5.11 🚀
    setSortKey, // v0.5.11 🚀
    setSortDirection, // v0.5.11 🚀
    setMultiSort, // v0.5.11 🚀
  } = useTable({
    data,
    columns: [
      { key: 'id', header: 'ID' },
      { key: 'name', header: 'Name', accessor: (row) => row.name.toUpperCase() },
    ],
    initialPageSize: 10,
  });

  return (
    <div>
      <input placeholder="Search..." onChange={(e) => setSearchQuery(e.target.value)} />
      <button onClick={() => exportToCsv('users.csv')}>Export</button>

      <table>
        <thead>
          <tr>
            {visibleColumns.map((col) => (
              <th key={col.key} onClick={() => handleSort(col.key)}>
                {col.header}
              </th>
            ))}
          </tr>
        </thead>
        <tbody>
          {paginatedData.map((row) => (
            <tr key={row.id}>
              <td>{row.id}</td>
              <td>{row.name}</td>
            </tr>
          ))}
        </tbody>
      </table>

      <div>
        Page {currentPage} of {totalPages}
      </div>
    </div>
  );
}

2. useRowSelection

Effortlessly manage selected rows for bulk actions.

import { useRowSelection } from '@typepurify/react-table';

const { selectedRowIds, toggleRowSelected, toggleAllRowsSelected } = useRowSelection();

3. URL State Serialization

Synchronize your table state (page, limit, sort) directly to your URL query params.

import { serializeTableState } from '@typepurify/react-table';

const queryParams = serializeTableState({
  currentPage: 2,
  pageSize: 20,
  sortKey: 'name',
  sortDirection: 'asc',
});
// => { page: 2, limit: 20, sort: 'name:asc' }

4. Bulk Column Visibility

Easily toggle visibility for all columns at once.

import { toggleAllColumnVisibility } from '@typepurify/react-table';

// Hide all columns
const nextVisibility = toggleAllColumnVisibility(currentVisibility, false);

🆕 New in v0.5.8

createTreeGridNodes(items, depth?) — Tree Grid Flattener

Flattens a recursive tree structure into a depth-annotated flat list for virtualized tree-grid rendering.

import { createTreeGridNodes } from '@typepurify/react-table';

const nodes = createTreeGridNodes([
  { id: '1', label: 'Root', children: [{ id: '1-1', label: 'Child' }] },
]);
// => [{ id: "1", depth: 0, hasChildren: true, ... }, { id: "1-1", depth: 1, hasChildren: false, ... }]

useInlineCellEditor() — Inline Cell Edit Hook

Manages per-cell edit state in inline editable tables.

import { useInlineCellEditor } from '@typepurify/react-table';

const { editingCell, editValue, startEditing, cancelEditing } = useInlineCellEditor();
startEditing(0, 'name', 'Alice');
// editingCell => { rowIndex: 0, columnKey: "name" }

🛡️ License

MIT © Vallarasu Kanthasamy


📋 Changelog

v0.5.4 — Latest

New Features:

  • createHeadlessTableCore(data, columns) — Computes unstyled headless table metadata: itemCount, columnKeys, and isEmpty. Use as the foundation for building fully custom UI table renderers.
import { createHeadlessTableCore } from '@typepurify/react-table';

const core = createHeadlessTableCore(
  [
    { id: 1, name: 'Alice' },
    { id: 2, name: 'Bob' },
  ],
  [{ key: 'id' }, { key: 'name' }],
);

console.log(core.itemCount); // 2
console.log(core.columnKeys); // ['id', 'name']
console.log(core.isEmpty); // false

Bug Fixes:

  • Fixed virtualizer scrollbar jump in measureVirtualizer by caching scroll position before re-measurement.

v0.5.1

  • Added toggleAllColumnVisibility for bulk column toggling.

0.5.8 Updates

Includes new features.