Skip to content

Frameworks Overview

NextGrid’s official adapter packages (next-grid-react, next-grid-vue, next-grid-svelte, next-grid-angular) are thin lifecycle, prop-sync, and portal/teleport bridges over next-grid-js/core. They never fork core rendering or virtualization behavior.

Package Target Framework Mounting Surface SSR
next-grid-react React 18 & 19 <NextGrid /> component Empty container on server; mounts on client
next-grid-vue Vue 3.4+ <NextGrid /> component Empty container on server; mounts on client
next-grid-svelte Svelte 5.46+ use:nextGrid action Action skipped on server; mounts on client
next-grid-angular Angular 21 & 22 (standalone) <next-grid /> component Empty <next-grid> on server; mounts in browser
Package Events Instance Access Renderers & Editors
next-grid-react on* props (onSortChanged) ref (Grid<T> | null) reactCellRenderer, reactPinnedCellRenderer, reactCellEditor (React Portals)
next-grid-vue @sort-changed, etc. Template ref (NextGridExposed<T>) vueCellRenderer, vuePinnedCellRenderer, vueCellEditor (Teleport)
next-grid-svelte on* options (onSortChanged) onGrid(grid | null) callback svelteCellRenderer, sveltePinnedCellRenderer, svelteCellEditor (mount + getAllContexts())
next-grid-angular (sortChanged), (gridError), (gridReady) (gridReady) & grid property angularCellRenderer, angularPinnedCellRenderer, angularCellEditor
  1. Create Once, Update Incrementally: Adapters instantiate Grid from next-grid-js/core once on mount and route mutable prop changes to GridApi setters (setColumnDefs, setRowData, setHierarchyOptions, setPivot, setPinnedRows, setCellSpans, setTheme, etc.).
  2. Value vs. Reference Comparison:
    • Plain objects and arrays on value-compared props (pivot, pinnedRows, cellSpans, columnGroups, etc.) are compared by value, so inline object literals do not trigger unnecessary updates.
    • columnDefs and rowData are compared by reference: memoize columnDefs (useMemo, computed, $derived, or class fields) so columns keep their runtime widths, pins, and sorting/filtering state.
    • Passing a new rowData array replaces all rows and starts a new dataEpoch (recreating cell renderers and clearing undo history). Use applyRowTransaction via the grid instance for in-place updates.
  3. Construction-Only Options: Options without a runtime setter (density, direction, localeText, rowHeight, modules, rowModelType, initialState, etc.) are read once at creation. Changing them later has no effect and logs a development warning; remount the grid (key, {#key}, or @if/@for) to apply a new value.
  4. Shared Component Editor Contract:
    • Focus moves automatically to the editor’s first focusable control (skipping hidden inputs, disabled controls, and unrendered nodes; elements with tabindex="-1" come last).
    • Enter commits (except inside <textarea>, where Ctrl/⌘ + Enter commits).
    • commit() and cancel() are bound to their own edit session — calling them after an edit ends (for example after late async validation) is a safe no-op.
  5. Menu Items, Full-Width & Detail: Menu items stay text-and-action objects in all adapters; full-width and detail rows use DOM renderers (FullWidthRenderer, DetailRenderer).

Frameworks Without an Official Adapter (Solid, Web Components, etc.)

Section titled “Frameworks Without an Official Adapter (Solid, Web Components, etc.)”

For frameworks without a dedicated package, mount Grid directly inside the framework’s lifecycle hook (onMount/onCleanup in Solid, connectedCallback/disconnectedCallback in Custom Elements) and call grid.destroy() on teardown.