Skip to content

Repository files navigation

OpenGridX | The Free Enterprise React DataGrid

OpenGridX Hero Banner

OpenGridX is a premium, high-performance React DataGrid engine designed to break the "Pay-to-Play" model in the React ecosystem. It provides a pure-custom, zero-dependency alternative to enterprise grids like MUI X DataGrid Pro and AG Grid, offering advanced features for free.

👉 Live Demo & Docs — Interactive showcase with full API documentation


🛠️ Getting Started

Installation

npm install @opencorestack/opengridx
import{DataGrid}from'@opencorestack/opengridx';

Styles: The CSS is bundled as a separate file (opengridx.css) alongside the JS. It is imported automatically via the package barrel in most setups. However, if your grid appears unstyled (Vite, Next.js App Router, or SSR environments sometimes skip side-effect CSS auto-detection), add this explicit import once — typically in your app's root file (main.tsx / layout.tsx):

import'@opencorestack/opengridx/styles';

⚡ Basic Example

import{DataGrid,GridColDef}from'@opencorestack/opengridx';constcolumns: GridColDef[]=[{field: 'id',headerName: 'ID',width: 70},{field: 'name',headerName: 'Name',width: 180},{field: 'role',headerName: 'Role',width: 150},{field: 'salary',headerName: 'Salary',width: 120,type: 'number',valueFormatter: ({ value })=>`$${(valueasnumber).toLocaleString()}`},{field: 'department',headerName: 'Department',width: 160},];constrows=[{id: 1,name: 'Jon Snow',role: 'Engineer',salary: 95000,department: 'Defense'},{id: 2,name: 'Cersei Lannister',role: 'Manager',salary: 140000,department: 'Management'},{id: 3,name: 'Arya Stark',role: 'Analyst',salary: 65000,department: 'Special Ops'},];exportdefaultfunctionApp(){return(<DataGridrows={rows}columns={columns}checkboxSelectionpaginationheight={400}/>);}

🚀 Key Features

  • High-Performance Virtualization: Custom-built engine handling 100,000+ rows at 60fps.
  • Advanced Layouts: Native support for Row & Column Spanning, Grouping, and Tree Data.
  • Data Orchestration: 11+ filter operators, multi-column sorting, and robust pagination.
  • Zero UI Dependencies: 100% vanilla CSS (BEM) and pure React/TypeScript logic.
  • Skeleton Loader: Built-in animated loading states with smart column detection.
  • Fully Customizable: Slots system for replacing any component (pagination, overlays, toolbar).
  • Export Functionality: Built-in CSV, Excel, JSON, and Print export.
  • Clipboard: Ctrl+C / Cmd+C copies selected rows as TSV for Excel/Sheets.
  • Accessibility: WCAG 2.1 AA — full ARIA roles and keyboard navigation.
  • Theming: CSS variable API with 5 built-in themes + custom theme support.
  • Column & Row Reordering: Drag-and-drop column reordering and row reordering.
  • Inline Cell Editing: Full inline editing with processRowUpdate validation.
  • State Persistence: Save and restore grid state (sort, filter, columns) via useGridStateStorage.
  • AI-Native Integration: Shipped with raw lib/ source and docs/ inside the npm package, allowing AI agents (Cursor, Copilot, Windsurf) to flawlessly implement features by "seeing" the internal logic.

🤖 AI-Powered Implementation

OpenGridX is built for the era of AI-native development. When you install @opencorestack/opengridx, we include the full raw source code and markdown documentation in your node_modules.

This means that Cursor, GitHub Copilot, Windsurf, and other AI agents can read the actual implementation patterns and docs to accurately help you build complex features like server-side tree data or pivot tables without guessing.

Tip for Cursor/Copilot users: If your AI is struggling, tell it to "Read the docs and source in ./node_modules/@opencorestack/opengridx/docs" for instant context.


📐 API Reference

Core Props

PropTypeDefaultDescription
rowsGridRowModel[]Required. Array of data rows.
columnsGridColDef[]Required. Column definitions.
heightnumber | string500Grid height in pixels or CSS string (e.g. '100%').
autoHeightbooleanfalseExpands grid height to fit all rows.
loadingbooleanfalseShows skeleton loader when true.
density'compact' | 'standard' | 'comfortable''standard'Visual row density.
checkboxSelectionbooleanfalseEnables checkbox column for row selection.
paginationbooleanfalseEnables client-side pagination.
paginationModel{ page: number; pageSize: number }Controlled pagination state.
onPaginationModelChange(model) => voidFires on page or page size change.
pageSizeOptionsnumber[][10, 25, 50]Available page size options.
getRowId(row) => GridRowIdrow.idCustom row ID accessor.
rowHeightnumber52Row height in pixels.
headerHeightnumber56Header height in pixels.
noRowsLabelstringCustom empty-state message.
classNamestringCustom CSS class on the grid container.
styleReact.CSSPropertiesCustom inline styles on the grid container.

Column Definitions (GridColDef)

PropertyTypeDefaultDescription
fieldstringRequired. Must match the row object key.
headerNamestringHeader label text.
descriptionstringTooltip on header hover.
widthnumber | string100Fixed width in px.
flexnumberFlex-grow weight — fills remaining space. Cannot be combined with width.
minWidthnumberMinimum width in px, enforced during resize.
maxWidthnumberMaximum width in px, enforced during resize.
align'left' | 'center' | 'right''left'Cell content alignment.
headerAlign'left' | 'center' | 'right''left'Header content alignment.
type'string' | 'number' | 'date' | 'boolean' | 'singleSelect' | 'image''string'Drives filter operators and default formatting.
valueOptionsArray<string | number | { value, label }>Options list for type: 'singleSelect'.
editablebooleanfalseEnables inline cell editing. Pair with processRowUpdate.
valueGetter(params) => unknownDerive a computed cell value from the row.
valueFormatter(params) => stringFormat the display string (does not affect edit or sort).
renderCell(params) => ReactNodeFully custom cell renderer.
renderHeader(params) => ReactNodeCustom header cell renderer.
renderEditCell(params) => ReactNodeCustom editor rendered in edit mode.
cellClassNamestring | ((params) => string)CSS class on every cell; use a function for conditional per-row styling.
headerClassNamestringCSS class on the header cell.
colSpannumber | ((params) => number)Merge cells horizontally.
rowSpannumber | ((params) => number)Merge cells vertically.
sortablebooleantrueEnable/disable column sorting.
filterablebooleantrueEnable/disable column filtering.
resizablebooleantrueAllow drag-resize.
hideablebooleantrueAllow hiding via the column panel.
pinnablebooleantrueAllow pinning via the UI.
disableColumnMenubooleanfalseHide the column header context menu.
exportablebooleantrueSet to false to exclude from all exports.
groupablebooleantrueAllow as a row grouping dimension.
aggregablebooleantrueAllow aggregation on this column.
availableAggregationFunctionsstring[]allRestrict which aggregation functions are offered.

Selection

PropTypeDescription
rowSelectionModelGridRowId[]Controlled selected row IDs.
onRowSelectionModelChange(model: GridRowId[]) => voidFires on selection change.
disableRowSelectionOnClickbooleanPrevent row click from toggling selection.
disableMultipleRowSelectionbooleanRestrict to single-row selection.
pinCheckboxColumnbooleanKeeps the checkbox column visible during horizontal scroll.

Sorting & Filtering

PropTypeDescription
sortModelGridSortItem[]Controlled sort model.
onSortModelChange(model: GridSortItem[]) => voidFires on sort change.
filterModelGridFilterModelControlled filter model.
onFilterModelChange(model: GridFilterModel) => voidFires on filter change.
disableColumnFilterbooleanDisables column-level filtering.

Columns

PropTypeDescription
columnVisibilityModelGridColumnVisibilityModelControlled column visibility.
onColumnVisibilityModelChange(model) => voidFires when column visibility changes.
columnOrderstring[]Controlled column field order.
onColumnOrderChange(params) => voidFires when columns are reordered.
disableColumnReorderbooleanDisables drag-and-drop column reordering.

Events

PropTypeDescription
onRowClick(params: GridRowParams) => voidFires when a row is clicked.
onCellClick(params: GridCellParams) => voidFires when a cell is clicked.
onRowsScrollEnd(params: GridRowScrollEndParams) => voidFires when scrolling reaches the bottom.

Server-Side

PropTypeDescription
paginationMode'client' | 'server' | 'infinite'Data fetching mode.
sortingMode'client' | 'server'Where sorting is applied.
filterMode'client' | 'server'Where filtering is applied.
dataSourceGridDataSourceServer-side data adapter.
rowCountnumberTotal rows for server-side pagination.

Pinning

PropTypeDescription
pinnedColumnsGridColumnPinningPin columns to left or right.
onPinnedColumnsChange(model) => voidFires when column pinning changes.
pinnedRowsGridRowPinningPin rows to top or bottom.
onPinnedRowsChange(model) => voidFires when row pinning changes.

Inline Editing

PropTypeDescription
isCellEditable(params: GridCellParams) => booleanPer-cell editability predicate.
processRowUpdate(newRow, oldRow) => R | Promise<R>Handles row save; supports async validation.
onProcessRowUpdateError(error: unknown) => voidFires if processRowUpdate throws.

Row Reordering

PropTypeDescription
rowReorderingbooleanEnables drag-and-drop row reordering.
onRowOrderChange(params) => voidFires when rows are reordered.

Advanced Features

PropTypeDescription
treeDatabooleanEnables hierarchical tree data display.
getTreeDataPath(row) => string[]Returns the path array for each row in tree mode.
groupingColDefGridColDefOverrides the auto-generated grouping column.
defaultGroupingExpansionDepthnumberInitial expansion depth for tree data.
rowGroupingModelGridRowGroupingModelControlled row grouping state.
onRowGroupingModelChange(model) => voidFires when grouping changes.
aggregationModelGridAggregationModelControlled aggregation state (e.g. { salary: 'sum' }).
onAggregationModelChange(model) => voidFires when aggregation changes.
pivotModebooleanSwitches the grid to multidimensional pivot mode.
pivotModelGridPivotModelControlled pivot configuration (rows, columns, values).
onPivotModelChange(model) => voidFires when pivot model changes.

Master-Detail

PropTypeDescription
getDetailPanelContent(params) => ReactNodeRenders the expandable detail panel.
getDetailPanelHeight(params) => number | 'auto'Controls detail panel height.
detailPanelExpandedRowIdsSet<GridRowId>Controlled expanded rows.
onDetailPanelExpandedRowIdsChange(ids) => voidFires when expanded rows change.

Customization

PropTypeDescription
slotsGridSlotsReplace built-in components (toolbar, pagination, overlays, footer).
slotPropsGridSlotPropsPass custom props to slot components.
getRowClassName(params) => stringAdd custom CSS class to rows.
getCellClassName(params) => stringAdd custom CSS class to cells.
themeGridThemeApply a custom theme object.

apiRef — Imperative API

constapiRef=useGridApiRef();<DataGridapiRef={apiRef}.../>
// Rows
apiRef.current.getRow(id) // → GridRowModel | null
apiRef.current.getAllRows() // → GridRowModel[]
apiRef.current.getVisibleRows() // → GridRowModel[] (post-filter/sort)
// Columns
apiRef.current.getColumn(field) // → GridColDef | null
apiRef.current.getAllColumns() // → GridColDef[]
apiRef.current.getVisibleColumns() // → GridColDef[]
// Selection
apiRef.current.selectRow(id, true)
apiRef.current.selectRows([id1, id2], true)
apiRef.current.getSelectedRows() // → GridRowId[]
// Sorting
apiRef.current.sortColumn('name', 'asc')
apiRef.current.getSortModel() // → GridSortItem[]
// Filtering
apiRef.current.setFilterModel(model)
apiRef.current.getFilterModel() // → GridFilterModel
// Pagination
apiRef.current.setPage(2)
apiRef.current.setPageSize(50)
// Scroll
apiRef.current.scrollToIndexes({rowIndex: 100,colIndex: 3})
// Clipboard
apiRef.current.copySelectedRows() // → Promise<void>
// Aggregation
apiRef.current.getAggregationResult() // → Record<string, unknown> | null
apiRef.current.getAggregationModel() // → GridAggregationModel | null

🎨 Customization & Extensibility

Slots System

Replace any built-in component with your own:

<DataGridrows={rows}columns={columns}slots={{toolbar: CustomToolbar,pagination: CustomPaginationComponent,noRowsOverlay: CustomEmptyState,loadingOverlay: CustomLoader,footer: CustomFooter}}slotProps={{toolbar: {/* custom props */},pagination: {/* custom props */}}}/>

Built-in Toolbar

import{DataGrid,GridToolbar}from'@opencorestack/opengridx';<DataGridrows={rows}columns={columns}slots={{toolbar: GridToolbar}}/>

GridToolbar provides global search, column visibility panel, filter panel, and export controls out of the box.

Export Functionality

OpenGridX has two tiers of Excel export:

import{exportToCsv,exportToExcel,// ✅ built-in, zero depsexportToExcelAdvanced,// ✅ rich .xlsx — requires: npm install exceljsexportToJson,printGrid}from'@opencorestack/opengridx';exportToCsv(rows,columns,{fileName: 'data.csv'});exportToExcel(rows,columns,{fileName: 'data.xlsx'});exportToExcelAdvanced(rows,columns,{fileName: 'data.xlsx',columnStyles: {avatar: {embedImage: true,imageWidth: 40,imageHeight: 40}}});exportToJson(rows,columns,{fileName: 'data.json'});printGrid(rows,columns,'Report Title');

Optional peer dependency:exportToExcelAdvanced requires ExcelJS:

npm install exceljs

State Persistence

import{useGridStateStorage}from'@opencorestack/opengridx';const{ initialState, onStateChange }=useGridStateStorage('my-grid-key');<DataGridrows={rows}columns={columns}initialState={initialState}onStateChange={onStateChange}/>

Theming

import{DataGridThemeProvider,darkTheme}from'@opencorestack/opengridx';<DataGridThemeProvidertheme={darkTheme}><DataGridrows={rows}columns={columns}/></DataGridThemeProvider>

Built-in themes: darkTheme, roseTheme, emeraldTheme, amberTheme, compactTheme


⚡ Performance & Bundle Size

ArtifactMinifiedGzippedNotes
Core ES Module (opengridx.es.js)242 KB58 KBUse this — tree-shakeable
Core UMD (opengridx.umd.js)164 KB48 KBCommonJS / CDN compat
Styles (opengridx.css)62 KB10 KBAuto-included
ExcelJS (optional peer dep)npm install exceljs
npm package download613 KBTotal compressed tarball
  • Tree-shaking Ready: ES Module build — bundlers (Vite, Webpack) only include what you use.
  • Zero UI Dependencies: No MUI, Ant Design, or Radix. Pure React + vanilla CSS.
  • Lazy Advanced Export: ExcelJS is an optional peer dep — not bundled, only used if you install it.
  • Efficient Rendering: Custom virtualization handles 100k+ rows with zero DOM churn.

📚 Documentation

Full documentation at 👉 opencorestack.github.io/OpenGridX

🏛️ Components

🚀 Features

📊 Advanced Data

🎨 Customization


🚀 Why OpenGridX?

Most React grids gatekeep essential features like Row Grouping, Excel Export, and Master-Detail behind expensive annual licenses. OpenGridX provides these premium capabilities out-of-the-box, with full source-code control and no external UI dependencies.

FeatureMUI FreeMUI Pro ($$$)AG Grid CommunityOpenGridX
Virtualization
Column Pinning
Row Grouping
Tree Data
Master-Detail
Excel Export
Advanced Filtering
Aggregation
Pivot Mode
Inline Cell Editing
State Persistence
PriceFree$$$Free (limited)Free

📝 License

MIT © 2026 Open Core Stack

About

High-performance React data infrastructure. Unlock advanced Row Grouping, Excel Export, and Column Pinning without the usual "Pro" gatekeeping. Built for speed, scale, and complete architectural freedom. Fully open, virtualization-ready, and feature-complete.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages