Skip to main content

Overview

OGrid is a lightweight, open-source React data grid library that delivers spreadsheet-grade features without the enterprise paywall. It ships React UI implementations for Radix and Fluent UI, all powered by a shared TypeScript core.

Note: Angular, Vue, vanilla JS, and Material UI adapters were available through earlier 2.9.x versions and remain on npm at those versions. New development is React-first (Radix / Fluent). See the project README's "Frozen adapters" section if you have an existing install on one of the frozen variants.

Why OGrid?

Most production-grade React data grids fall into one of two camps: free but limited, or feature-rich but locked behind expensive licenses. OGrid bridges that gap.

  • Free and MIT-licensed. Every feature is included. No enterprise tier, no feature gating.
  • 25+ built-in features. Sorting, filtering, pagination, cell editing, clipboard, undo/redo, fill handle, row selection, cell range selection, column pinning, column groups, CSV export, context menu, keyboard navigation, cell references, virtual scrolling, status bar, sidebar, and more.
  • Two React UI flavors. Pick Radix or Fluent — switch later with a one-line import change.
  • TypeScript-first. Full strict-mode TypeScript with exported types for every prop, event, and API method.
  • Lightweight. The Radix package has no heavy framework dependency. Fluent uses @fluentui/react-components as a peer dependency.

Architecture

OGrid is built on a 3-layer architecture: a pure TypeScript core, a React adapter layer, and thin UI shells. No duplicated logic, no drift.

UI Packages
@alaarab/ogrid-react-radix
Radix Primitives
@alaarab/ogrid-react-fluent
Fluent UI v9
React Adapter
@alaarab/ogrid-react
Hooks · Headless components
Core
@alaarab/ogrid-core
Types · Algorithms · Utilities  ·  zero dependencies

Core Layer - @alaarab/ogrid-core

Pure TypeScript with zero dependencies. Provides the type system (IOGridProps, IColumnDef, IOGridApi, FilterValue, etc.) and shared algorithms (getCellValue, buildHeaderRows, parseValue, normalizeSelectionRange, etc.) consumed by the React adapter.

React Adapter - @alaarab/ogrid-react

Translates Core's algorithms into idiomatic React hooks.

DomainHooks
OrchestrationuseOGrid · useDataGridState
Cell EditinguseCellEditing · useInlineCellEditorState · useRichSelectState
SelectionuseCellSelection · useRowSelection · useActiveCell
NavigationuseKeyboardNavigation (arrow keys, Tab, Enter, Ctrl+Arrow)
ClipboarduseClipboard · useFillHandle · useUndoRedo
LayoutuseColumnResize · useSideBarState · useColumnChooserState
FilteringuseColumnHeaderFilterState · useFilterOptions

UI Layer - Pick Your Design System

Each UI package is a thin shell (~1,500 lines) that calls the same core logic and renders into native components:

PackageBuilt onBest for
@alaarab/ogrid-react-radixRadix primitivesLightweight apps, custom design systems
@alaarab/ogrid-react-fluentFluent UI v9Microsoft 365, SharePoint, Teams apps

Both packages export the same OGrid component with the same props. Switching design systems is a one-line import change - your column definitions, event handlers, data sources, and API calls stay identical.

Why This Matters

  • Shared core, aligned behavior. Most behavior is implemented once in core, with package-specific docs and tests calling out the remaining differences.
  • Zero lock-in. Migrate between React UI flavors without rewriting business logic.
  • Small surface area. No duplicated state logic to drift out of sync.

Packages

PackagenpmDescription
@alaarab/ogrid-corenpmPure TS types, algorithms, utilities (zero deps)
React
@alaarab/ogrid-reactnpmReact hooks, headless components, utilities
@alaarab/ogrid-react-radixnpmRadix UI implementation (default, lightweight)
@alaarab/ogrid-react-fluentnpmFluent UI v9 implementation

Feature Highlights

FeatureDescription
SortingSingle-column sort with ascending/descending toggle
FilteringText, multi-select, and people filters per column
PaginationClient-side or server-side with configurable page sizes
Cell EditingInline text, select, checkbox, and rich select editors
Cell SelectionSpreadsheet-style range selection with drag support
ClipboardCopy/paste with multi-cell support (Ctrl+C / Ctrl+V)
Fill HandleDrag to fill cells (like Excel)
Undo/RedoFull undo/redo stack for cell edits
Row SelectionSingle or multiple row selection with checkbox column
Column PinningPin columns to left or right edge
Column GroupsMulti-row grouped column headers
Column ChooserShow/hide columns with a dropdown
Context MenuRight-click menu with copy, paste, undo, and export
CSV ExportOne-click export to CSV
Keyboard NavigationArrow keys, Tab, Enter, Page Down/Up, Ctrl+Home/End
Cell ReferencesExcel-style column letters (A, B, C...), row numbers, name box
Status BarRow count, filtered count, selected count, and aggregations
SidebarColumn visibility and filter panels in a collapsible sidebar
Server-Side DataIDataSource interface for server-side pagination and filtering
Grid APIImperative IOGridApi ref for programmatic control
Column ResizeDrag column borders to resize
Virtual ScrollingRow and column virtualization for 10K+ row datasets
Web Worker SortBackground-thread sorting for 50K+ rows
ThemingInherits your framework's theme automatically

Coming from AG Grid?

OGrid is designed as a drop-in replacement for AG Grid with a simpler, more React-idiomatic API. If you are migrating from AG Grid, see the Migration Guide.

Browser verification

OGrid's browser checks now have an explicit contract:

  • A fast smoke suite runs on every push through the main CI workflow
  • The broader Playwright matrix runs across the active React example apps only when you dispatch it manually

See the Browser Support Matrix for the current coverage map and commands.

Next Steps