
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
tanstack-react-table
Advanced tools
A production-ready, highly customizable React table component built with [TanStack Table](https://tanstack.com/table), [Radix UI](https://www.radix-ui.com/), DnD Kit, and TypeScript. Feature-rich, accessible, performant, and designed for real business nee
A production-ready, highly customizable React table component built with TanStack Table, Radix UI, DnD Kit, and TypeScript. Feature-rich, accessible, performant, and designed for real business needs.
npm install react-table-component
# or
yarn add react-table-component
# or
bun add react-table-component
Peer dependencies:
react
^19react-dom
^19@tanstack/react-table
^8
import React from "react";
import { TableComponent } from "react-table-component";
import type { ColumnProps } from "react-table-component";
const columns: ColumnProps[] = [
{
id: "name",
header: "Name",
type: "text",
width: 200,
},
{
id: "email",
header: "Email",
type: "email",
width: 250,
},
{
id: "age",
header: "Age",
type: "number",
width: 100,
},
];
const data = [
{ id: "1", name: "John Doe", email: "john@example.com", age: 30 },
{ id: "2", name: "Jane Smith", email: "jane@example.com", age: 25 },
];
function MyTable() {
return (
{
console.log("Event:", type, value);
}}
onEndReached={() => {}}
/>
);
}
Built-in Radix UI-based cell editors:
interface ColumnProps {
id: string; // Unique key
header: string | JSX.Element; // Header cell
type?: string; // text | number | select | etc.
width?: number;
minWidth?: number;
maxWidth?: number;
enableSorting?: boolean;
enableResizing?: boolean;
enableHiding?: boolean;
enablePinning?: boolean;
enableOrdering?: boolean;
render?: (props) => JSX.Element; // Custom cell renderer
headerRender?: () => JSX.Element; // Custom header
footerRender?: () => JSX.Element; // Custom footer
fixed?: "left" | "right";
meta?: Record;
}
Efficient rendering for huge datasets:
<TableComponent dataSource={largeData} columns={columns} isVirtual={true} rowHeight={50} />
const nestedData = [
{
id: "1",
name: "Parent Row",
subRows: [
{ id: "1-1", name: "Child Row 1" },
{ id: "1-2", name: "Child Row 2" },
],
},
];
import { MyCustomCell } from "./MyCustomCell";
Use your own or built-in Tailwind themes, Radix states, or external theme libraries.
Prop | Type | Description |
---|---|---|
dataSource | Array | Table data |
columns | ColumnProps[] | Column definitions |
rowKey | string | Unique ID key for rows |
showSerialNumber | boolean | Show row numbers |
showRowSelection | boolean | Show checkboxes for selection |
isVirtual | boolean | Enable virtualized rendering |
rowHeight | number | Row height (px) |
expandable | object | Tree/row expansion config |
options | object | Feature toggles (sorting, etc) |
onEventUpdate | function | Event callback |
onEndReached | function | Infinite scroll callback |
const tableRef = useRef(null);
// Usage:
tableRef.current?.addRow(newRow);
tableRef.current?.removeRow("row-id");
tableRef.current?.updateRow("row-id", { name: "Changed" });
tableRef.current?.expandRow("row-id");
tableRef.current?.selectRow("row-id", true);
tableRef.current?.getSelectedRows();
const handleEventUpdate = ({ type, value }) => {
switch (type) {
case "cell-edit": /* ... */ break;
case "row-select": /* ... */ break;
case "column-resize": /* ... */ break;
// ...
}
};
React.memo
rowKey
# Install deps
bun install
# Start dev server
bun run dev
# Build the library
bun run build
# Run tests
bun test
# Lint/fix
bun run lint
bun run format
# Typecheck
bun run typecheck
git checkout -b feat/new-feature
)git commit -m "Add new feature"
)MIT License – see the LICENSE file for details.
© 2025 Aravinthan
FAQs
A production-ready, highly customizable React table component built with [TanStack Table](https://tanstack.com/table), [Radix UI](https://www.radix-ui.com/), DnD Kit, and TypeScript. Feature-rich, accessible, performant, and designed for real business nee
The npm package tanstack-react-table receives a total of 32 weekly downloads. As such, tanstack-react-table popularity was classified as not popular.
We found that tanstack-react-table demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.