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

@invana/tables

v0.0.40

Published

Invana Design System - Data table components

Readme

@invana/tables

Data table components for Invana products — TanStack Table v8 underneath, @invana/ui on top, with drag-to-reorder columns and editable cells.

pnpm add @invana/tables

Peer dependencies: @invana/ui, @invana/styling, @invana/forms, react, react-dom.

Three tables

Pick by where the rows are and how many there are. All three share one core, so sorting, inline editing (meta.editable + onCellEdit), row and cell highlighting (isRowHighlighted, isCellHighlighted, isRowSelected, isTotalRow), grouping, nesting (getSubRows), expanding (renderExpanded), density, seamless and the column features (visibility, pinning, reordering, resizing) behave the same in each.

| Component | Rows | Adds | | --- | --- | --- | | DataTable | every row, in hand | preview (first rows of a longer table, Open all) | | PaginatedTable | every row, in hand | search, column picker, pages, rows-per-page | | RemotePaginatedTable | on a server | fetchPage — debounce, abort, page reset, loading, error + retry |

import { DataTable, PaginatedTable, RemotePaginatedTable, type ColumnDef } from '@invana/tables';

type Run = { id: string; task: string; status: string; duration: string };

const columns: ColumnDef<Run>[] = [
  { accessorKey: 'task', header: 'Task', meta: { editable: true } },
  { accessorKey: 'status', header: 'Status' },
  { accessorKey: 'duration', header: 'Duration', meta: { align: 'right', mono: true } },
];

<DataTable columns={columns} data={rows} />

<PaginatedTable columns={columns} data={rows} pageSizeOptions={[10, 25, 50]} onCellEdit={save} />

<RemotePaginatedTable
  columns={columns}
  fetchPage={async ({ pageIndex, pageSize, sorting, search, signal }) => {
    const res = await fetch(url({ pageIndex, pageSize, sorting, search }), {
      signal,
      headers: { Authorization: `Bearer ${token}` },
    });
    const json = await res.json();
    return { rows: json.items, total: json.total };
  }}
/>

fetchPage owns the transport — URL, headers, auth, GraphQL — and is read through a ref, so an inline function does not refetch on every render. Change refreshKey to fetch the current page again.

Search, filters and sorting

Declared the same way on both paged tables; where the work happens is the table's. PaginatedTable runs them in memory (filter → search → sort → page); RemotePaginatedTable sends them to fetchPage as { filters, search, sorting }. Either way a change goes back to page 1 and the callbacks (onFiltersChange, onSearchChange, onSortingChange) hear it.

const filters: TableFilter<Run>[] = [
  { id: 'status', label: 'status' },                       // choices from the rows (PaginatedTable)
  { id: 'agent', label: 'agent', options: ['planner', 'researcher'] },
  { id: 'slow', label: 'took', single: true, options: ['> 1s'],
    match: (row) => row.durationMs > 1000 },               // in memory only
];

<PaginatedTable columns={columns} data={rows} filters={filters} noun="runs" />
<RemotePaginatedTable columns={columns} filters={filters} fetchPage={({ filters, sorting, search }) => …} />

Within a chip any pick matches; across chips all must. filterValues / defaultFilterValues and sorting / defaultSorting control or seed the state; noun labels the count at the end of the filter row.

Inline edits

A column opts in with meta.editable. onCellEdit receives a CellEdit — everything needed to write the change elsewhere:

| Field | | | --- | --- | | value / previousValue | new and old value (an emptied number is null) | | rowId | getRowId's answer, or the position id | | columnId / field | the column, and the accessor path it reads (order.quantity) | | row / updatedRow | the row, and a copy with the change applied | | ancestors | parent rows, outermost first (nested tables) |

// to a server — reject to put the old value back
onCellEdit={({ rowId, field, value }) =>
  fetch(`/api/items/${rowId}`, { method: 'PATCH', body: JSON.stringify({ [field!]: value }) })}

// to the parent's state
onCellEdit={(edit) => setRows((rows) => applyCellEdit(rows, edit, { subRowsKey: 'children' }))}

RemotePaginatedTable writes a successful edit into the page it is showing, so the value stays without a refetch.

Page size

The rows-per-page picker on both paged tables offers 10, 25, 50, 100 and ends in Custom…, a number field capped at maxPageSize (500). Pass your own pageSizeOptions, allowCustomPageSize={false} to drop Custom…, or pageSizeOptions={false} for no picker. It hides itself when every row fits the smallest size.

Column options live on meta: editable / editType / options, align, mono, control (an always-on sm control in the cell), and the cellClassName / headerClassName escape hatches.

Exports

  • DataTable, PaginatedTable, RemotePaginatedTable (and their …Props, plus TableBaseProps)
  • DataTableToolbar — search, caller controls and the column picker
  • DataTablePagination — page controls
  • EditableCell — in-place cell editing, with CellEdit, CellEditHandler, EditType and EditOption
  • applyCellEdit — writes a CellEdit into an array of rows, immutably
  • RemotePageQuery, RemotePage — the fetchPage contract

TanStack's state types are re-exported so consumers need not add @tanstack/react-table directly: ColumnDef, SortingState, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ExpandedState, PaginationState, VisibilityState.

License

MIT © Ravi Raja Merugu