@ez-kit/data-grid-core
v0.1.0
Published
Headless, UI-framework-agnostic data-grid core for @ez-kit/data-grid (built on TanStack Table core).
Readme
@ez-kit/data-grid-core
Headless, UI-framework-agnostic data-grid core for @ez-kit/data-grid, built on top of TanStack Table core. It owns columns, features (sorting, filtering, operators, pagination, selection, pinning, editing, creating, deleting, validation, infinite loading) and table state — with no React and no styling.
Most apps should use a UI flavour instead:
@ez-kit/data-grid-shadcn— Shadcn UI@ez-kit/data-grid-heroui— HeroUI@ez-kit/data-grid-native— plain/native UI
Use this package directly only when building your own adapter.
Install
pnpm add @ez-kit/data-grid-core @tanstack/table-corereact and zod are optional peer dependencies (needed only for the React adapters and for zodResolver validation, respectively).
Usage
import { createTable, defineColumns } from '@ez-kit/data-grid-core'
const columns = defineColumns([
{ accessorKey: 'name', header: 'Name' },
{ accessorKey: 'role', header: 'Role' },
])
const table = createTable({
data: [{ name: 'Ada Lovelace', role: 'Engineer' }],
columns,
sorting: true,
filtering: true,
})The returned table is a TanStack Table instance extended with the data-grid features. Read table.getRowModel(), drive state via table.setState(...), and render it with your own UI or one of the flavour packages above.
License
MIT
