A modern, typed, and extensible DataGrid library for React, built on:
- Context-driven modular state
- Controller/state slices
- A UI-agnostic design that lets you provide your own table component
- A rich hook API for interaction, pagination, selection, mode control, and events
This version (0.3.x) introduces a fully modular architecture with context slices, a unified provider, and new hooks.
- βοΈ React-first API
- π§ Context-driven state slices (data, actions, pagination, selection, focus, mode)
- π§© DataGridProvider with external control support
- π Full hook suite for granular access & composition
- π¨ UI-agnostic: renderer is fully under your control
- π§ͺ Built-in Vitest + React Testing Library
- π€ Automated releases with Changesets + GitHub Actions
- π¦ Tree-shakable ES modules
npm install @entiqon/datagridor
yarn add @entiqon/datagridimport DataGrid, { DataGridView } from '@entiqon/datagrid';
export default function App() {
return (
<DataGrid data={rows} columns={columns}>
<DataGridView />
</DataGrid>
);
}import { DataGridProvider } from '@entiqon/datagrid';
export default function App() {
return (
<DataGridProvider data={rows} columns={columns}>
<CustomGrid />
</DataGridProvider>
);
}const { rows, setRows, updateRow, removeRow } = useData();const { refresh, reload } = useActions();const { page, pageSize, total, next, prev, setPage } = usePagination();const { selected, toggle, clear, selectAll } = useSelection();const { focusedRow, setFocusedRow } = useFocus();const { mode, setMode, isCreate, isUpdate } = useGridMode();const { current } = useCurrentRow();useGridEvents({
onRowClick(row) {},
onSelectionChange(selected) {},
});const { data, actions, pagination, selection, focus, mode } = useDataGrid();const { page, next, prev } = usePagination();const { selected, toggle } = useSelection();const { mode, setMode, isCreate } = useGridMode();export function MyGrid() {
const { data } = useData();
const { selected } = useSelection();
}{
"paths": {
"@context/*": ["src/context/*"],
"@contracts": ["src/contracts/index.ts"],
"@hooks": ["src/hooks/index.ts"]
}
}npm test
npm run test:watch
npm run build- Changesets
- GitHub Actions
MIT Β© ENTIQON