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

@ai-path/tb-react

v0.4.2

Published

React bindings for Taible: a canvas-rendered, virtualized data grid with DOM editing overlay, multi-level grouping headers, and IME-aware editing.

Downloads

512

Readme

@ai-path/tb-react

The canvas-rendered, virtualized React data grid for Taible. <LatticaGrid> is a thin view over a headless GridController that owns the formula engine, row/column sizing, selection, and undo. The cell body is painted on a single <canvas> for performance, while headers and the active-cell editor stay in the DOM for accessibility and IME-aware input. All non-trivial math lives in pure, tested modules (geometry, scene, painter, keyboard, scroll, measure).

Install

pnpm add @ai-path/tb-react

API overview

LatticaGrid + useGridController

Create a controller with useGridController and pass it to <LatticaGrid>.

import { LatticaGrid, useGridController } from '@ai-path/tb-react';

function Sheet() {
  const controller = useGridController({ rowCount: 1000, colCount: 26 });
  controller.setCellText(0, 0, 'Hello');
  controller.setCellText(1, 0, '=2+2');
  return <LatticaGrid controller={controller} width={800} height={500} />;
}

LatticaGridProps also accepts columns (multi-level ColumnNode[]), theme (Partial<GridTheme>), className, style, and a contextMenu builder.

Driving the controller

The controller exposes intent-level methods that the view renders:

controller.setCellText(2, 0, '=SUM(A1:A2)'); // undoable edit
controller.getDisplay(2, 0);                 // formatted value, e.g. '4'
controller.toggleSort(0);                    // sort by visual column 0
controller.setColumnFilter(1, [{ kind: 'gt', value: 100 }]);
controller.runSearch('total', { caseSensitive: false }); // returns hit count
controller.undoLast();

Cell types

The CellTypeRegistry maps a column type name to a CellRenderer. defaultCellTypes ships with text, number, and boolean renderers (builtinRenderers); register your own and assign it to a column.

import { defaultCellTypes, drawCellText, type CellRenderer } from '@ai-path/tb-react';

const badge: CellRenderer = (ctx) => drawCellText({ ...ctx, align: 'center' });
defaultCellTypes.register('badge', badge);
controller.setColumnType(2, 'badge'); // physical column index

Theming & presets

import { resolveTheme, themePresets, getPreset, darkTheme } from '@ai-path/tb-react';

const theme = resolveTheme({ ...darkTheme });
const preset = getPreset('highContrast'); // from themePresets

Other exports

  • Geometry/hit-testing: hitTest, cellRect, columnAt, rowAt, maxScroll.
  • Rendering internals: buildScene, paintScene (Canvas2D), visibleIndices.
  • Interaction: interpretKey, ShortcutRegistry / normalizeChord, buildMenu / findItem / runItem.
  • Sizing: wrapText, autoColumnWidth, autoRowHeight.
  • Accessibility: gridAria, rowAria, cellAria, columnHeaderAria, rowHeaderAria.
  • i18n: I18n, enUS, jaJP.
  • Resize hit-testing: hitColumnBorder, hitRowBorder, hitResizeHandle.