2.2.10 • Published 1 year ago
@proofgeist/mantine-tanstack-table v2.2.10
mantine-tanstack-table
An opinionated table component with default styling for Mantine 7 and TanStack Table 8.
Initialize the useReactTable
hook and pass it into this component to get a fully functional table with sorting, filtering, pagination, and more.
Installation
pnpm i @proofgeist/mantine-tanstack-table
Requires @tanstack/react-table
and @mantine/core
as peer dependencies.
pnpm install dayjs @mantine/dates
Basic Example (minimal)
import TanstackTable from "@proofgeist/mantine-tanstack-table";
import {
useReactTable,
getCoreRowModel,
createColumnHelper,
} from "@tanstack/react-table";
// this CSS only needs to be imported once in your entire app
// and can be ignored if you want to use your own styles
import "@proofgeist/mantine-tanstack-table/styles.css";
type TData = { name: string };
const columnHelper = createColumnHelper<TData>();
// define your columns outside of your component to avoid re-renders
// or within a useMemo hook if needed to be inside the component
const columns = [columnHelper.accessor("name", { header: "Name" })];
function MyComponent() {
const table = useReactTable({
data: [], // add your data here
columns,
getCoreRowModel: getCoreRowModel(),
});
return <TanstackTable table={table} />;
}
More examples to come
2.2.10
1 year ago
2.2.9
1 year ago
2.2.1
2 years ago
2.1.2
2 years ago
2.0.3
2 years ago
2.2.0
2 years ago
2.1.1
2 years ago
2.0.2
2 years ago
2.2.3
2 years ago
2.1.4
2 years ago
2.2.2
2 years ago
2.1.3
2 years ago
2.0.4
2 years ago
2.2.5
2 years ago
2.1.6
2 years ago
2.2.4
2 years ago
2.1.5
2 years ago
2.2.7
2 years ago
2.1.8
2 years ago
2.2.6
2 years ago
2.1.7
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago
2.2.8
2 years ago
2.1.9
2 years ago
1.0.0
2 years ago