Zero dependencies
Vanilla TypeScript, ESM + CJS + a single IIFE for script tags. No jQuery, no CSS framework, nothing to keep in sync.
Zero dependencies. A design your page's CSS can't break. Native-table accessibility. Typed columns and small composable modules. Talks to your server the way it already works.
A server-side grid with a column menu, saved view, reload button and export menu. The server runs inside this page; the Request tab shows exactly what goes over the wire.
import { Datagrid, column, serverSide, yajra, colVis, stateSave, button, excel, csv, print } from "@akinozgen17/datagrids";
import { statusLabels, statusTones } from "./data.js";
new Datagrid("#home-grid", {
label: "Field agents",
columns: [
// plain columns follow the protocol: yajra escapes strings on the server, so they render as HTML
{ key: "ref", title: "Ref" },
{ key: "name", title: "Name" },
{ key: "unit", title: "Unit" },
{ key: "task", title: "Task", visible: false },
column.badge("status", { title: "Status", labels: statusLabels, tones: statusTones }),
column.money("amount", { title: "Amount", currency: "USD", locale: "en-US" }),
column.date("date", { title: "Date", time: true }),
],
sort: [["date", "desc"]],
pageSize: 10,
count: true,
use: [
serverSide({ url: "/api/agents", protocol: yajra(), csrf: true }),
colVis(),
button.reload(),
stateSave(),
excel(),
csv(),
print(),
],
});<table id="home-grid"></table>npm i @akinozgen17/datagridsimport { Datagrid, column, serverSide, yajra } from "@akinozgen17/datagrids";
import "@akinozgen17/datagrids/css";Then read Getting started and Concepts. Moving an existing grid over? The migration guide maps options, events and API calls one by one.