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

@tc96/datagrid

v0.2.1

Published

Domain-neutral DataGrid view for React applications using COSS and Base UI.

Readme

DataGrid

A domain-neutral, accessible DataGrid view for React applications built with COSS, Base UI, TanStack Table, and Tailwind CSS.

The package provides the interaction and presentation layer for SaaS collection views. Your application remains responsible for business columns, permissions, remote state, mutations, navigation, and persistence.

DataGrid overview

Highlights

  • WAI-ARIA grid semantics and roving keyboard focus
  • sorting, filtering, pagination, selection, resizing, visibility, and pinning
  • stable row identity through TanStack Table's getRowId
  • opt-in editable select cells and row creation
  • loading, empty, grouped, overflow, and virtualized states
  • threshold-based horizontal drag scrolling that preserves clicks and controls
  • composable toolbar controls with no product-specific actions
  • COSS visual primitives implemented on Base UI

Requirements

  • React 19
  • Base UI 1.x
  • Tailwind CSS 4

The package is COSS-first. COSS is distributed as source through its component registry, so this repository owns the small set of COSS primitives required by the view. A future Radix implementation will be a separate adapter and will not change the domain-neutral contract.

Installation

Install the published package with your package manager:

pnpm add @tc96/datagrid
# or: bun add @tc96/datagrid
# or: npm install @tc96/datagrid

The consumer must already provide the peer dependencies:

pnpm add react react-dom @base-ui/react tailwindcss

COSS source location

@tc96/datagrid supports two installation modes. Use the npm package when you want to import it from node_modules. Use the bundled registry item when you want the source copied into the consuming app.

Keep ui mapped to your primitive components and add patterns for TC96 patterns. patterns is not a replacement for ui:

{
  "$schema": "https://ui.shadcn.com/schema.json",
  "tsx": true,
  "aliases": {
    "components": "@/components",
    "ui": "@/components/ui",
    "patterns": "@/components/patterns"
  }
}

After installing the package, add the local registry item:

bun add @tc96/datagrid
bunx shadcn@latest add ./node_modules/@tc96/datagrid/registry/datagrid.json

The registry item targets @patterns/datagrid, which resolves through aliases.patterns and keeps ./components/ui untouched. This is intentional: consumer-owned primitives remain under aliases.ui, while TC96 pattern source is installed under aliases.patterns.

Alias compatibility

The registry install is safe for projects whose UI primitives live in components/ui. DataGrid source is installed under the patterns alias and its implementation-private COSS/Base UI primitives are copied inside that pattern folder. It does not overwrite or import from the consumer's ui alias.

Required alias contract:

| Alias | Purpose | | --- | --- | | ui | Consumer-owned primitives, commonly @/components/ui | | patterns | TC96 source patterns, commonly @/components/patterns |

Do not map patterns to components/ui. The pattern source and app primitives must stay separate so consumers can keep their existing COSS/shadcn primitive catalog without file conflicts.

Tailwind must scan the installed package and your theme must expose the standard COSS semantic tokens:

@import "tailwindcss";
@source "../node_modules/@tc96/datagrid/dist";

Quick start

import {
  DataGrid,
  DataGridSearch,
  DataGridToolbar,
  DataGridViewOptions,
  useDataGrid,
  type DataGridColumnDef,
} from "@tc96/datagrid";

type RecordItem = {
  id: string;
  name: string;
  status: string;
};

const columns: DataGridColumnDef<RecordItem>[] = [
  {
    accessorKey: "name",
    header: "Name",
    meta: { label: "Name", type: "title" },
  },
  {
    accessorKey: "status",
    header: "Status",
    meta: { label: "Status", type: "status", variant: "badge" },
  },
];

export function RecordsView({ records }: { records: RecordItem[] }) {
  const { table } = useDataGrid({
    columns,
    data: records,
    getRowId: (record) => record.id,
  });

  return (
    <>
      <DataGridToolbar>
        <DataGridSearch table={table} />
        <DataGridViewOptions table={table} />
      </DataGridToolbar>
      <DataGrid aria-label="Records" table={table} />
    </>
  );
}

Use @tc96/datagrid/core when a non-visual layer only needs the public types and constants.

Ownership boundary

| Package owns | Consumer owns | | --- | --- | | grid semantics and keyboard behavior | domain column definitions and labels | | view state wired through TanStack Table | server state, loading orchestration, and errors | | generic cells and toolbar primitives | permissions and available actions | | local drag-scroll and virtualization | mutations, optimistic updates, and persistence | | presentation-level callbacks | navigation and product workflows |

The package never infers authorization or a valid business transition from the shape of the data.

Development

Use Bun 1.3.14 and Node 24.18.0.

bun install
bun run storybook
bun run lint:ci
bun run typecheck
bun test
bun run build

See CONTRIBUTING.md for the contribution workflow and ADR-001 for the adapter decision.

License

MIT © Gabriel Melo.