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

better-table

v1.3.0

Published

A modern, flexible, and fully typed React data table component

Readme

better-table

A modern, flexible, and fully typed data table component for React.

✨ Features

  • 🔍 Search & Filter — Global search with debounce + floating filters / filter panel / both
  • 📊 Sorting — Single & multi-sort with 3-state cycle (asc → desc → unsorted)
  • 👁️ Column Visibility — Interactive toggle to show/hide columns at runtime
  • 🔄 Column Resizing — Drag-to-resize with min/max width constraints
  • 📂 Expandable Rows — Detail rows with controlled/uncontrolled + accordion mode
  • Virtualization — Built-in row virtualization for large datasets (zero deps)
  • 🌐 Server-Side Mode — Delegate sorting, filtering, pagination to your API
  • 📌 Sticky Headers — Headers stay visible when scrolling
  • Selection — Single or multiple row selection with global actions
  • 🎬 Row Actions — Callbacks, modals, links + overflow menu
  • 📱 Responsive — Card layout for mobile, collapsible toolbar
  • 📄 Pagination — Configurable page sizes, quick jumper
  • 🌍 i18n — Preset locales (EN/ES/PT) + custom overrides
  • 🎨 Customizable — CSS variables, custom renderers, class overrides
  • Accessible — ARIA labels, aria-live announcements, focus trap in modals
  • 💪 TypeScript — Full type safety with generics

📚 Documentation

| Document | Description | | --- | --- | | Architecture | Design patterns and technical decisions | | Components | Detailed API reference for all components | | Interaction Flows | Sequence diagrams and component interactions | | Known Issues | Known bugs, limitations and workarounds | | Development | Contributing guide and local setup | | Roadmap | Future improvements and features | | Changelog | Version history |

🚀 Quick Start

npm install better-table

Basic Usage

import { BetterTable } from "better-table";
import "better-table/styles.css";

const MyTable = () => {
	const data = [
		{ id: 1, name: "Juan", email: "[email protected]", active: true },
		{ id: 2, name: "María", email: "[email protected]", active: false },
	];

	const columns = [
		{ id: "name", accessor: "name", header: "Name", sortable: true },
		{ id: "email", accessor: "email", header: "Email" },
		{ id: "active", accessor: "active", header: "Status", type: "boolean" },
	];

	return <BetterTable data={data} columns={columns} rowKey="id" />;
};

Column Resizing

<BetterTable
	data={users}
	columns={[
		{ id: "name", accessor: "name", header: "Name", resizable: true, minWidth: 100 },
		{ id: "email", accessor: "email", header: "Email", resizable: true },
	]}
	rowKey="id"
	resizable
/>

Expandable Rows

<BetterTable
	data={users}
	columns={columns}
	rowKey="id"
	expandable={{
		render: (row) => <div>Details for {row.name}</div>,
		accordion: true,
	}}
/>

Server-Side Data

<BetterTable
	data={serverData}
	columns={columns}
	rowKey="id"
	manualPagination
	manualSorting
	pagination={{ pageSize: 10, totalItems: total }}
	onPageChange={(page, size) => fetchData({ page, size })}
	onSortChange={(sort) => fetchData({ sort })}
/>

Virtualization

// Auto-enables when pagination={false} and dataset > 500 rows
<BetterTable
	data={largeDataset}
	columns={columns}
	rowKey="id"
	pagination={false}
	stickyHeader
/>

Multi-Sort & Column Visibility

<BetterTable
	data={users}
	columns={columns}
	rowKey="id"
	multiSort
	columnVisibility
/>

Filter Modes

<BetterTable data={data} columns={columns} filterMode="floating" /> {/* default */}
<BetterTable data={data} columns={columns} filterMode="panel" />
<BetterTable data={data} columns={columns} filterMode="both" />

Internationalization (i18n)

<BetterTable data={data} columns={columns} locale="es" />
<BetterTable data={data} columns={columns} locale={{ noData: "Nothing to show" }} />

🎨 Customization

CSS Variables

:root {
	--bt-primary-color: #3b82f6;
	--bt-border-color: #e5e7eb;
	--bt-hover-bg: #f3f4f6;
	--bt-selected-bg: #dbeafe;
}

Custom Class Names

<BetterTable
	data={data}
	columns={columns}
	classNames={{
		container: "my-table-container",
		table: "my-table",
		row: "my-row",
		cell: "my-cell",
	}}
/>

📦 API Reference

See Components Documentation for complete API reference.

Main Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | data | T[] | - | Array of data to display | | columns | Column<T>[] | - | Column configuration | | rowKey | keyof T \| Function | 'id' | Unique key for rows | | searchable | boolean | false | Enable search toolbar | | searchDebounceMs | number | 300 | Search debounce delay (ms) | | filterMode | 'floating' \| 'panel' \| 'both' | 'floating' | Filter display mode | | multiSort | boolean | false | Enable multi-column sorting | | columnVisibility | boolean | false | Show column visibility toggle | | resizable | boolean | false | Enable column resizing | | expandable | ExpandableConfig<T> | - | Expandable row config | | virtualize | boolean | auto | Enable row virtualization | | stickyHeader | boolean | false | Sticky table header | | manualSorting | boolean | false | Skip client-side sorting | | manualFiltering | boolean | false | Skip client-side filtering | | manualPagination | boolean | false | Skip client-side pagination | | pagination | PaginationConfig \| false | { pageSize: 10 } | Pagination settings | | selectionMode | 'single' \| 'multiple' | - | Selection mode | | rowActions | RowAction<T>[] | [] | Per-row actions | | globalActions | GlobalAction<T>[] | [] | Global toolbar actions | | locale | LocaleKey \| TableLocale | 'en' | Locale preset or custom strings | | loading | boolean | false | Loading state |

📄 License

Apache-2.0