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

react-tanstack-virtual-table

v0.1.10

Published

A lightweight virtualized table built with TanStack Table + TanStack Virtual for React

Readme

React TanStack Virtual Table

A high-performance, feature-rich virtualized table component for React built on top of TanStack Table and TanStack Virtual. Inspired by professional grid libraries like Handsontable and AG Grid.

✨ Features

  • 🚀 Virtualization: Efficiently render thousands of rows with smooth scrolling
  • ⌨️ Keyboard Navigation: Full keyboard support (Arrow keys, Tab, Enter, F2, Escape)
  • ✏️ Cell Editing: Double-click or press Enter/F2 to edit cells inline
  • 🎨 Theming: Built-in light/dark themes with CSS variables for easy customization
  • 📏 Auto Column Sizing: Optional automatic column width calculation based on content
  • 🎯 Cell Selection: Click to select, double-click to edit
  • 📊 Column Sorting: Built-in column sorting support
  • 🎭 Customizable: Extensive styling options and theme overrides
  • 📱 Responsive: Works seamlessly across different screen sizes

📦 Installation

npm install react-tanstack-virtual-table

or

yarn add react-tanstack-virtual-table

or

pnpm add react-tanstack-virtual-table

Peer Dependencies

This library requires React 18+ and the following peer dependencies:

npm install react react-dom @tanstack/react-table @tanstack/react-virtual

🚀 Quick Start

Important: Don't forget to import the CSS file! Add this import to your application entry point:

import "react-tanstack-virtual-table/dist/index.css";

Then use the component:

import { VirtualTable } from "react-tanstack-virtual-table";
import type { ColumnDef } from "@tanstack/react-table";

type Person = {
  name: string;
  age: number;
  email: string;
};

const data: Person[] = [
  { name: "John Doe", age: 30, email: "[email protected]" },
  { name: "Jane Smith", age: 25, email: "[email protected]" },
  // ... more data
];

const columns: ColumnDef<Person>[] = [
  {
    header: "Name",
    accessorKey: "name",
  },
  {
    header: "Age",
    accessorKey: "age",
  },
  {
    header: "Email",
    accessorKey: "email",
  },
];

function App() {
  return <VirtualTable data={data} columns={columns} height={600} />;
}

📚 Documentation

🎨 Examples

Basic Table

<VirtualTable data={data} columns={columns} height={400} />

Editable Table

<VirtualTable
  data={data}
  columns={columns}
  height={400}
  readonly={false}
  onCellValueChange={(rowIndex, columnId, value) => {
    console.log(`Row ${rowIndex}, Column ${columnId}: ${value}`);
    // Update your data here
  }}
/>

Dark Theme

<VirtualTable data={data} columns={columns} height={400} theme="dark" />

Custom Styling

<VirtualTable
  data={data}
  columns={columns}
  height={400}
  themeOverride={{
    "--vt-bg": "#ffffff",
    "--vt-border": "#e0e0e0",
    "--vt-text": "#333333",
  }}
/>

Auto Column Sizing

<VirtualTable
  data={data}
  columns={columns}
  height={400}
  autoFitColumnWidth={true}
  autoFitOptions={{
    minWidth: 80,
    maxWidth: 400,
    padding: 16,
  }}
/>

⌨️ Keyboard Shortcuts

  • Arrow Keys: Navigate between cells
  • Tab / Shift+Tab: Move to next/previous cell (wraps to next row)
  • Enter / F2: Enter edit mode for selected cell
  • Escape: Exit edit mode (keeps selection)
  • Click: Select a cell
  • Double-Click: Select and edit a cell

🎯 Features in Detail

Virtualization

The table uses row virtualization to efficiently render large datasets. Only visible rows are rendered in the DOM, ensuring smooth performance even with thousands of rows.

Cell Selection & Editing

  • Click a cell to select it (blue focus ring appears)
  • Double-click or press Enter/F2 to enter edit mode
  • Escape to exit edit mode
  • The focus ring follows the selected/editing cell during scrolling

Column Highlighting

When a cell is selected or being edited:

  • The corresponding column header is highlighted
  • The row number in the left header is highlighted

Sorting

Click on any column header to sort. Click again to reverse the sort order.

🛠️ Development

# Install dependencies
npm install

# Run development server
npm run dev

# Build library
npm run build

# Run Storybook (after setup)
npm run storybook

📄 License

MIT

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📖 Learn More