# datagrids > Zero-dependency, accessible data grid that enhances plain HTML tables A small grid core with typed columns plus independent modules attached with `use`. Server protocols: the classic SSP wire (yajra/laravel-datatables), the datagrids protocol v1 and Laravel paginator JSON. Styling is isolated under `--dg-*` tokens. Start with the cheat sheet: llm.md. ## Table of Contents ### Introduction - [Getting started](https://akinozgen.github.io/datagrids/guide/getting-started.md): Install datagrids, load the stylesheet, turn a table into a grid, then point it at a server endpoint. - [Concepts: grid, columns, modules, pipelines](https://akinozgen.github.io/datagrids/guide/concepts.md): The mental model behind datagrids — a small grid core, typed columns, and independent modules that plug into well-defined pipelines. ### Essentials - [Columns](https://akinozgen.github.io/datagrids/guide/columns.md): Typed column factories, render functions, the text-by-default rule, export values, widths in CSS and per-column permissions. - [Data sources](https://akinozgen.github.io/datagrids/guide/data-sources.md): Client mode (array, existing DOM rows, fetch once) versus server mode (serverSide with a protocol), plus custom sources and row keys. - [Server protocols](https://akinozgen.github.io/datagrids/guide/server-protocols.md): serverSide transport options, the three built-in protocols (classic SSP wire with the yajra preset, Laravel paginator, datagrids protocol v1), CSRF, Laravel headers, error normalization and session expiry. - [Lifecycle](https://akinozgen.github.io/datagrids/guide/lifecycle.md): Load modes (eager, visible, manual), reload, accessing grids (get, find, reload by name), destroy and remount, runtime column changes and declarative init with upgrade() and presets. - [States & errors](https://akinozgen.github.io/datagrids/guide/states-and-errors.md): The loading, empty, no-match, error and manual states, the busy indicator on reloads, error banners, retry, errorMode and the data-state attribute. ### Look & feel - [Theming](https://akinozgen.github.io/datagrids/guide/theming.md): Component-scoped --dg-* tokens, one-line rebranding with an inherited --dg-accent, --dg-rem scaling, dark mode via the host color-scheme, size and density axes, header style, card surface and a high-contrast recipe. - [Localization & RTL](https://akinozgen.github.io/datagrids/guide/i18n.md): Message packs (en, tr), locale resolution, overriding strings, locale-aware search and sorting, number and date formats, and right-to-left layouts. - [Anatomy (DOM contract)](https://akinozgen.github.io/datagrids/guide/anatomy.md): The public DOM contract — stable classes, attributes and state selectors you can target from CSS and tests, and what is covered by semantic versioning. ### Quality - [Accessibility](https://akinozgen.github.io/datagrids/guide/accessibility.md): Accessibility statement — native table semantics, sortable header buttons with aria-sort, skip link, live announcements, keyboard support, focus handling, contrast, reduced motion, forced colors and known limitations. - [Performance](https://akinozgen.github.io/datagrids/guide/performance.md): How datagrids renders, automatic virtual rows from 300 rows, measured numbers with their method, bundle size, and practical advice for large lists. ### Data & view - [stateSave](https://akinozgen.github.io/datagrids/modules/state-save.md): Remember each user's sort, page size and hidden columns per grid in localStorage, with versioning, a sliding expiry and a one-call reset. - [colVis](https://akinozgen.github.io/datagrids/modules/colvis.md): A "Columns" toolbar menu with native checkboxes to show and hide columns, locked columns, show all and reset to default. - [colReorder](https://akinozgen.github.io/datagrids/modules/col-reorder.md): Let users reorder columns by dragging a header or with move buttons in the column menu; display order only, requests keep the definition order. - [responsive](https://akinozgen.github.io/datagrids/modules/responsive.md): When the table is wider than its frame, collapse the least important columns and show their values in an expandable detail row. - [lazyColumns](https://akinozgen.github.io/datagrids/modules/lazy-columns.md): Mark expensive server columns as lazy — they are requested only while visible, and showing one reloads the current page in place. - [stickyHeader](https://akinozgen.github.io/datagrids/modules/sticky-header.md): Keep the column header visible while the page scrolls, even when the table sits in a horizontally scrolling frame. - [filterPresets](https://akinozgen.github.io/datagrids/modules/filter-presets.md): Named filter presets as a chip group in the toolbar — one click sets several filter values in one load, and the active chip follows the filters. - [autoRefresh](https://akinozgen.github.io/datagrids/modules/auto-refresh.md): Reload a grid silently on an interval, keeping the page, and skip ticks while the tab is hidden, a load runs, a menu is open or the user is typing. - [multiSort](https://akinozgen.github.io/datagrids/modules/multi-sort.md): Sort by several columns — Shift+click (or Shift+Enter) adds a header as the next sort key, with its rank shown in the header. - [columnFilters](https://akinozgen.github.io/datagrids/modules/column-filters.md): A filter button in each column header with operators that fit the column type, active-filter chips, and wire encoding for yajra (ColumnControl) and the datagrids protocol. - [filterPanel](https://akinozgen.github.io/datagrids/modules/filter-panel.md): Bind your own filter form to a grid — its values become request parameters on server grids and filter state on client grids, with auto-reload, debounce and a small API. - [urlSync](https://akinozgen.github.io/datagrids/modules/url-sync.md): Keep a grid's search, sort, page and filter values in the query string so every view is a shareable link that survives reloads and the back button. - [softDeletes](https://akinozgen.github.io/datagrids/modules/soft-deletes.md): A "Show deleted" toolbar toggle that sends _deleted=1 to the server (or filters in the browser) and mutes deleted rows. ### Rows - [actions](https://akinozgen.github.io/datagrids/modules/actions.md): Row actions defined once in the frontend — inline buttons or a primary button plus a ⋯ menu, links, requests or handlers, confirm dialogs, permissions with reasons. - [selection](https://akinozgen.github.io/datagrids/modules/selection.md): Checkbox row selection that survives paging and filtering, "select all N matching" for server grids, a persistent bulk-action bar and a payload your endpoint can act on. - [rowReorder](https://akinozgen.github.io/datagrids/modules/row-reorder.md): Let users reorder rows by dragging a grip or with the keyboard, and save the new order through one onEnd callback. - [keyboardGrid](https://akinozgen.github.io/datagrids/modules/keyboard-grid.md): Opt-in APG grid keyboard navigation on the native table — one tab stop, arrow keys between cells, Home/End, Ctrl+Home/End and PageUp/PageDown. ### Output - [excel · csv · print](https://akinozgen.github.io/datagrids/modules/export.md): Export the grid as a dependency-free XLSX file with real numbers and dates, as CSV, or as a light print view (and PDF from the browser) — all from one Export menu. - [footer](https://akinozgen.github.io/datagrids/modules/footer.md): A summary row in the table's tfoot — sum, average, count or your own function per column, over the current page or every matching row. - [metaBind](https://akinozgen.github.io/datagrids/modules/meta-bind.md): Bind fields of the server response — totals, counters, flags — to elements anywhere on the page, refreshed after every load. - [Toolbar buttons](https://akinozgen.github.io/datagrids/modules/buttons.md): Ready-made toolbar buttons — reload and reset view — plus your own buttons and dropdowns, each attached as a module. ### Laravel - [Laravel + yajra list](https://akinozgen.github.io/datagrids/recipes/laravel-yajra.md): Point a grid at an existing yajra/laravel-datatables controller without changing it — HTML columns, extra page parameters and joined columns included. - [Laravel paginator & API resources](https://akinozgen.github.io/datagrids/recipes/laravel-paginator.md): Use the JSON of Laravel's paginate(), simplePaginate() or JsonResource::collection() directly as a server-paged grid source. - [CSRF & session expiry](https://akinozgen.github.io/datagrids/recipes/csrf-and-session.md): Send Laravel's CSRF token with every grid request and handle an expired session (419, 401, redirect to login) in one place. ### Pages - [Page filter panel](https://akinozgen.github.io/datagrids/recipes/filter-panel.md): Drive a server grid from a filter form above it — selects, multi-selects and debounced text — and keep the view in a shareable URL. - [Selection + bulk action](https://akinozgen.github.io/datagrids/recipes/bulk-actions.md): Select rows across pages or all rows matching the current search, then send one POST that handles both payload shapes. - [Row actions with confirm](https://akinozgen.github.io/datagrids/recipes/row-actions.md): A per-row action menu with links, server requests, confirmation, permission flags and disabled reasons — plus your own confirm and toast libraries. - [Export](https://akinozgen.github.io/datagrids/recipes/export.md): Add Excel, CSV and print to a server grid, choose between the current page and all filtered rows, and hand huge exports to the server with grid.query(). - [Custom toolbar (headless)](https://akinozgen.github.io/datagrids/recipes/custom-toolbar.md): Drive a grid from your own search box, sort and page-size controls through its methods and events, or place your own elements into the toolbar slots with a tiny module. ### Lifecycle - [Grids in tabs & modals](https://akinozgen.github.io/datagrids/recipes/tabs-and-modals.md): Delay a grid's first request until its tab or dialog is shown with load "visible" or load "manual", without any column re-alignment calls. - [Destroy, re-init & Livewire](https://akinozgen.github.io/datagrids/recipes/destroy-and-reinit.md): Tear a grid down to the original table, re-create it safely, initialize tables declaratively with upgrade() and presets, and coexist with Livewire morphing and Turbo navigation. ### Reference - [Grid options](https://akinozgen.github.io/datagrids/reference/options.md): Every option of new Datagrid(table, options) with its type, default and effect, including the defaults that come from configure(). - [Column options](https://akinozgen.github.io/datagrids/reference/columns.md): Every ColumnDef field, every column factory (column.text … column.select, column.boolean) with its extra options and defaults, and the cell render-mode rules. - [Instance methods](https://akinozgen.github.io/datagrids/reference/methods.md): Every member of a grid instance (DatagridApi) with signature, return value and behaviour, plus the API each module adds to the grid. - [Events](https://akinozgen.github.io/datagrids/reference/events.md): Every grid event with its payload, whether it can be cancelled and exactly when it fires, plus the dg:* DOM events and delegate(). - [Static API & configure()](https://akinozgen.github.io/datagrids/reference/static.md): Package-level exports — Datagrid.get, get, find, reload, configure() with every global key and default, upgrade() and its data attributes, preset(), VERSION, message packs and config. - [Writing a module](https://akinozgen.github.io/datagrids/reference/modules.md): The ModuleDef shape, every ModuleContext member, the request middleware model and the wiring errors, with a complete toolbar module and request middleware example. - [Messages (i18n keys)](https://akinozgen.github.io/datagrids/reference/messages.md): Every UI string key of the grid with its English and Turkish default, how to override them, and the message keys of each module. - [CSS tokens](https://akinozgen.github.io/datagrids/reference/css.md): Every public --dg-* design token with its default and meaning, the two input tokens, the root attributes that switch size, density, theme and states, and the host hooks. - [Warning codes](https://akinozgen.github.io/datagrids/errors.md): Every coded datagrids console warning and thrown error (DG001–DG015) with its message, cause and fix, plus the uncoded module messages. ### Reference - [Grid options](https://akinozgen.github.io/datagrids/reference/options.md): Every option of new Datagrid(table, options) with its type, default and effect, including the defaults that come from configure(). - [Column options](https://akinozgen.github.io/datagrids/reference/columns.md): Every ColumnDef field, every column factory (column.text … column.select, column.boolean) with its extra options and defaults, and the cell render-mode rules. - [Instance methods](https://akinozgen.github.io/datagrids/reference/methods.md): Every member of a grid instance (DatagridApi) with signature, return value and behaviour, plus the API each module adds to the grid. - [Events](https://akinozgen.github.io/datagrids/reference/events.md): Every grid event with its payload, whether it can be cancelled and exactly when it fires, plus the dg:* DOM events and delegate(). - [Static API & configure()](https://akinozgen.github.io/datagrids/reference/static.md): Package-level exports — Datagrid.get, get, find, reload, configure() with every global key and default, upgrade() and its data attributes, preset(), VERSION, message packs and config. - [Writing a module](https://akinozgen.github.io/datagrids/reference/modules.md): The ModuleDef shape, every ModuleContext member, the request middleware model and the wiring errors, with a complete toolbar module and request middleware example. - [Messages (i18n keys)](https://akinozgen.github.io/datagrids/reference/messages.md): Every UI string key of the grid with its English and Turkish default, how to override them, and the message keys of each module. - [CSS tokens](https://akinozgen.github.io/datagrids/reference/css.md): Every public --dg-* design token with its default and meaning, the two input tokens, the root attributes that switch size, density, theme and states, and the host hooks. - [Warning codes](https://akinozgen.github.io/datagrids/errors.md): Every coded datagrids console warning and thrown error (DG001–DG015) with its message, cause and fix, plus the uncoded module messages. ### Server protocols - [Server protocols](https://akinozgen.github.io/datagrids/protocol.md): Which wire protocol to use between a datagrids grid and your server (SSP via ssp() or yajra(), Laravel paginator JSON, or the datagrids protocol v1) and how they differ. - [SSP wire (ssp / yajra)](https://akinozgen.github.io/datagrids/protocol/ssp.md): The exact request and response format datagrids uses with DataTables-style server-side processing endpoints (ssp() and yajra()), including encoding rules, column filters and error normalization. - [Laravel paginator](https://akinozgen.github.io/datagrids/protocol/laravel-paginator.md): How laravelPaginator() maps Laravel's paginate(), simplePaginate(), cursorPaginate() and API resource collection JSON to a grid, and which query parameters it sends. - [datagrids protocol v1](https://akinozgen.github.io/datagrids/protocol/v1.md): Normative specification of the datagrids protocol (dgp) v1, a JSON protocol for paged, sorted and filtered lists with typed filters, optional counting and RFC 9457 errors. ### Migration - [Migration](https://akinozgen.github.io/datagrids/migration.md): Guides for moving existing tables from other grid libraries to datagrids, one page at a time. - [Migrating from DataTables](https://akinozgen.github.io/datagrids/migration/from-datatables.md): Map DataTables 1.10, 2.x and 3.x options, events and API calls to datagrids, keep your server endpoints, and migrate one page at a time. ### Introduction - [Getting started](https://akinozgen.github.io/datagrids/guide/getting-started.md): Install datagrids, load the stylesheet, turn a table into a grid, then point it at a server endpoint. - [Concepts: grid, columns, modules, pipelines](https://akinozgen.github.io/datagrids/guide/concepts.md): The mental model behind datagrids — a small grid core, typed columns, and independent modules that plug into well-defined pipelines. ### Essentials - [Columns](https://akinozgen.github.io/datagrids/guide/columns.md): Typed column factories, render functions, the text-by-default rule, export values, widths in CSS and per-column permissions. - [Data sources](https://akinozgen.github.io/datagrids/guide/data-sources.md): Client mode (array, existing DOM rows, fetch once) versus server mode (serverSide with a protocol), plus custom sources and row keys. - [Server protocols](https://akinozgen.github.io/datagrids/guide/server-protocols.md): serverSide transport options, the three built-in protocols (classic SSP wire with the yajra preset, Laravel paginator, datagrids protocol v1), CSRF, Laravel headers, error normalization and session expiry. - [Lifecycle](https://akinozgen.github.io/datagrids/guide/lifecycle.md): Load modes (eager, visible, manual), reload, accessing grids (get, find, reload by name), destroy and remount, runtime column changes and declarative init with upgrade() and presets. - [States & errors](https://akinozgen.github.io/datagrids/guide/states-and-errors.md): The loading, empty, no-match, error and manual states, the busy indicator on reloads, error banners, retry, errorMode and the data-state attribute. ### Look & feel - [Theming](https://akinozgen.github.io/datagrids/guide/theming.md): Component-scoped --dg-* tokens, one-line rebranding with an inherited --dg-accent, --dg-rem scaling, dark mode via the host color-scheme, size and density axes, header style, card surface and a high-contrast recipe. - [Localization & RTL](https://akinozgen.github.io/datagrids/guide/i18n.md): Message packs (en, tr), locale resolution, overriding strings, locale-aware search and sorting, number and date formats, and right-to-left layouts. - [Anatomy (DOM contract)](https://akinozgen.github.io/datagrids/guide/anatomy.md): The public DOM contract — stable classes, attributes and state selectors you can target from CSS and tests, and what is covered by semantic versioning. ### Quality - [Accessibility](https://akinozgen.github.io/datagrids/guide/accessibility.md): Accessibility statement — native table semantics, sortable header buttons with aria-sort, skip link, live announcements, keyboard support, focus handling, contrast, reduced motion, forced colors and known limitations. - [Performance](https://akinozgen.github.io/datagrids/guide/performance.md): How datagrids renders, automatic virtual rows from 300 rows, measured numbers with their method, bundle size, and practical advice for large lists. ### Reference - [Grid options](https://akinozgen.github.io/datagrids/reference/options.md): Every option of new Datagrid(table, options) with its type, default and effect, including the defaults that come from configure(). - [Column options](https://akinozgen.github.io/datagrids/reference/columns.md): Every ColumnDef field, every column factory (column.text … column.select, column.boolean) with its extra options and defaults, and the cell render-mode rules. - [Instance methods](https://akinozgen.github.io/datagrids/reference/methods.md): Every member of a grid instance (DatagridApi) with signature, return value and behaviour, plus the API each module adds to the grid. - [Events](https://akinozgen.github.io/datagrids/reference/events.md): Every grid event with its payload, whether it can be cancelled and exactly when it fires, plus the dg:* DOM events and delegate(). - [Static API & configure()](https://akinozgen.github.io/datagrids/reference/static.md): Package-level exports — Datagrid.get, get, find, reload, configure() with every global key and default, upgrade() and its data attributes, preset(), VERSION, message packs and config. - [Writing a module](https://akinozgen.github.io/datagrids/reference/modules.md): The ModuleDef shape, every ModuleContext member, the request middleware model and the wiring errors, with a complete toolbar module and request middleware example. - [Messages (i18n keys)](https://akinozgen.github.io/datagrids/reference/messages.md): Every UI string key of the grid with its English and Turkish default, how to override them, and the message keys of each module. - [CSS tokens](https://akinozgen.github.io/datagrids/reference/css.md): Every public --dg-* design token with its default and meaning, the two input tokens, the root attributes that switch size, density, theme and states, and the host hooks. - [Warning codes](https://akinozgen.github.io/datagrids/errors.md): Every coded datagrids console warning and thrown error (DG001–DG015) with its message, cause and fix, plus the uncoded module messages. ### Other - [DG001: Unknown grid option](https://akinozgen.github.io/datagrids/errors/DG001.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG002: Grid has no accessible name](https://akinozgen.github.io/datagrids/errors/DG002.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG003: Rows have no key](https://akinozgen.github.io/datagrids/errors/DG003.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG004: Unknown column key](https://akinozgen.github.io/datagrids/errors/DG004.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG005: Selector must match exactly one table](https://akinozgen.github.io/datagrids/errors/DG005.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG006: No grid with that name](https://akinozgen.github.io/datagrids/errors/DG006.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG007: Required module is missing](https://akinozgen.github.io/datagrids/errors/DG007.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG008: Two modules claim one slot](https://akinozgen.github.io/datagrids/errors/DG008.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG009: Module attached twice](https://akinozgen.github.io/datagrids/errors/DG009.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG010: Module name collides with a grid member](https://akinozgen.github.io/datagrids/errors/DG010.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG011: Document has no language](https://akinozgen.github.io/datagrids/errors/DG011.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG012: Server error details](https://akinozgen.github.io/datagrids/errors/DG012.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG013: Page size above maxPageSize](https://akinozgen.github.io/datagrids/errors/DG013.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG014: Grid state could not be saved](https://akinozgen.github.io/datagrids/errors/DG014.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [DG015: Invalid locale](https://akinozgen.github.io/datagrids/errors/DG015.md): One datagrids warning or error code — the message, when it happens and how to fix it. - [LLM cheat sheet](https://akinozgen.github.io/datagrids/llm.md): The complete datagrids API in one page for AI coding agents — options, columns, modules, methods, events, protocols, tokens, recipes and gotchas. - [Modules](https://akinozgen.github.io/datagrids/modules.md): Catalog of every datagrids module — what it does, how to import it, where its API lives on the grid and which pipelines it plugs into. - [Recipes](https://akinozgen.github.io/datagrids/recipes.md): Task-first guides for common list pages — Laravel back ends, filters, selection, row actions, export, custom toolbars, tabs and re-initialization.