Skip to content

Styling Hooks

NextGrid exposes a documented set of semantic CSS classes and data-* attributes on its retained DOM structure. Undocumented internal elements and runtime frame timing are internal implementation details and may change between releases.

Class Meaning
.grid-container Root container element mounted inside options.container
.next-grid-theme-light / .next-grid-theme-dark Theme classes applied on .grid-container or ancestor elements
.grid-body-viewport The single native vertical and horizontal scroll container
.grid-row-selected / .grid-cell-selected Selected row or cell inside range selection
.grid-focus-active Currently focused body cell, header cell, or content shell
.grid-pointer-modality Added to the navigation root after pointer presses to suppress unwanted header focus outlines
.grid-menu-target Marks a body target cell/row outside active selection while bodyMenu is open
.grid-cell-copied / .grid-cell-pasted Temporary 800 ms highlight bound to logical cell identity on copy/cut/paste
.grid-clipboard-status Polite role="status" live region for clipboard announcements
.grid-cell-editing / .grid-editor / .grid-editor-invalid Active editor mount, wrapper, and invalid validation state
.grid-column-resize-guide Vertical resize guide line during pointer column resizing
.grid-column-drag-preview / .grid-column-drop-indicator Floating preview and target drop marker during column drag reorder
.grid-row-content-layer / .grid-row-content-shell Host layer and pooled shell for full-width rows and Master/Detail panels
.grid-group-toggle Expand/collapse control inside generated hierarchy group columns
.grid-overlay-wrapper / .grid-overlay-loading / .grid-overlay-no-rows Overlay layer and states inside the viewport

NextGrid does not provide rowClass or cellClass string callbacks on GridOptions or ColumnDef. To style cells conditionally based on row values, use cellRenderer (or fullWidthRenderer for full-row banners):

{
key: 'status',
name: 'Status',
cellRenderer: ({ formattedValue, document }) => {
const badge = document.createElement('span');
const apply = (text: string) => {
badge.textContent = text;
badge.className = text === 'Paid' ? 'badge-ok' : 'badge-warn';
};
apply(formattedValue);
return {
element: badge,
update: ({ formattedValue: next }) => {
apply(next);
return true;
},
destroy: () => badge.remove(),
};
},
}