DataTable
Easy to use table and datagrids built using TanStack Table.
#
Documentation
#
#
Install
#
Install the required peer dependencies to start using this component:
npm install @tanstack/react-table
#
Usage
#
First Name | Last Name | Status | Amount |
---|---|---|---|
Arthur | Morgan | success | $20 |
John | Marston | processing | $12.75 |
Micah | Bell | failed | $1.25 |
import { DataTable } from "@optiaxiom/react/unstable";
import { getCoreRowModel, useReactTable } from "@tanstack/react-table";
import { columns } from "./columns";
import { data } from "./data";
export function App() {
const table = useReactTable({
columns,
data,
getCoreRowModel: getCoreRowModel(),
});
return <DataTable table={table} />;
}
#
Props
#
#
DataTable
#
Supports all Box props in addition to its own. Renders a <div>
element.
Prop |
---|
asChild Change the default rendered element for the one passed as a child, merging their props and behavior. Read the Composition guide for more details. false | true |
className string |
table* Pass the table instance returned from Table<any> |
#
Changelog
#
#
0.3.0
#
- Added component