Convert Figma logo to code with AI

orneryd logoui-grid

UI Grid: a Data Grid

5,377
2,410
5,377
2

Top Related Projects

15,514

The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

A lightning fast JavaScript grid/spreadsheet

JavaScript Data Grid / Data Table with a Spreadsheet Look & Feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡

28,395

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table

React components for efficiently rendering large lists and tabular data

Quick Overview

UI-Grid is a powerful data grid component for AngularJS applications. It provides features like sorting, filtering, and pagination, allowing developers to create complex and interactive tables with ease. The project aims to offer a flexible and customizable solution for displaying large datasets in web applications.

Pros

  • Highly customizable with numerous built-in features
  • Excellent performance for handling large datasets
  • Active community and regular updates
  • Extensive documentation and examples

Cons

  • Steep learning curve for advanced features
  • Can be overkill for simple table needs
  • Limited compatibility with newer Angular versions (2+)
  • Some users report occasional bugs and inconsistencies

Code Examples

  1. Basic grid setup:
$scope.gridOptions = {
  enableSorting: true,
  enableFiltering: true,
  columnDefs: [
    { field: 'name' },
    { field: 'age', type: 'number' },
    { field: 'company' }
  ],
  data: myData
};
  1. Custom cell template:
$scope.gridOptions.columnDefs = [
  {
    field: 'status',
    cellTemplate: '<div class="ui-grid-cell-contents">' +
                  '<span ng-if="row.entity.status === \'active\'" class="green-dot"></span>' +
                  '<span ng-if="row.entity.status === \'inactive\'" class="red-dot"></span>' +
                  '{{row.entity.status}}' +
                  '</div>'
  }
];
  1. Pagination:
$scope.gridOptions = {
  paginationPageSizes: [25, 50, 75],
  paginationPageSize: 25,
  enablePaginationControls: true
};

Getting Started

  1. Install UI-Grid using npm:

    npm install angular-ui-grid
    
  2. Include UI-Grid in your AngularJS module:

    angular.module('myApp', ['ui.grid']);
    
  3. Add the grid to your HTML:

    <div ui-grid="gridOptions" class="myGrid"></div>
    
  4. Define grid options in your controller:

    $scope.gridOptions = {
      columnDefs: [
        { field: 'name' },
        { field: 'age' }
      ],
      data: [
        { name: 'John', age: 25 },
        { name: 'Jane', age: 30 }
      ]
    };
    

Competitor Comparisons

15,514

The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

Pros of ag-grid

  • More feature-rich with advanced functionality like pivoting, grouping, and aggregation
  • Better performance for large datasets, handling millions of rows efficiently
  • Extensive documentation and active community support

Cons of ag-grid

  • Steeper learning curve due to its complexity and extensive API
  • Commercial license required for enterprise features, potentially increasing costs

Code Comparison

ui-grid:

<div ui-grid="gridOptions" class="myGrid"></div>

ag-grid:

<ag-grid-angular
    style="width: 100%; height: 100%;"
    class="ag-theme-alpine"
    [rowData]="rowData"
    [columnDefs]="columnDefs">
</ag-grid-angular>

Key Differences

  • ui-grid is specifically designed for AngularJS, while ag-grid supports multiple frameworks including Angular, React, and Vue
  • ag-grid offers more customization options and themes out of the box
  • ui-grid has a simpler API, making it easier to get started for basic use cases
  • ag-grid provides better export functionality, including Excel export with styling

Community and Maintenance

  • ui-grid has fewer recent updates and a smaller community compared to ag-grid
  • ag-grid is actively maintained with frequent releases and updates
  • Both projects have open-source versions, but ag-grid also offers a paid enterprise version with additional features

A lightning fast JavaScript grid/spreadsheet

Pros of SlickGrid

  • Lightweight and fast, especially for large datasets
  • More flexible and customizable
  • Framework-agnostic, can be used with various JavaScript libraries

Cons of SlickGrid

  • Less active development and community support
  • Steeper learning curve due to lower-level API
  • Fewer built-in features compared to ui-grid

Code Comparison

SlickGrid:

var grid = new Slick.Grid("#myGrid", data, columns, options);
grid.onCellChange.subscribe(function (e, args) {
  // Handle cell change
});

ui-grid:

$scope.gridOptions = {
  data: 'myData',
  columnDefs: [
    { field: 'name', displayName: 'Name' },
    { field: 'age', displayName: 'Age' }
  ]
};

SlickGrid offers more granular control over grid initialization and event handling, while ui-grid provides a more declarative approach with Angular-specific bindings. SlickGrid's API is lower-level, giving developers more flexibility but requiring more setup code. ui-grid, being built for Angular, integrates more seamlessly with Angular applications and offers a simpler configuration syntax.

JavaScript Data Grid / Data Table with a Spreadsheet Look & Feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡

Pros of Handsontable

  • Framework-agnostic, can be used with various JavaScript libraries and frameworks
  • More extensive set of features, including advanced data manipulation and editing capabilities
  • Better performance with large datasets due to virtual rendering

Cons of Handsontable

  • Steeper learning curve due to more complex API and configuration options
  • Commercial license required for some features and use cases
  • Larger file size, which may impact initial load times

Code Comparison

UI-Grid:

$scope.gridOptions = {
  enableSorting: true,
  columnDefs: [
    { field: 'name' },
    { field: 'age', type: 'number' }
  ],
  data: myData
};

Handsontable:

const hot = new Handsontable(container, {
  data: myData,
  columns: [
    { data: 'name' },
    { data: 'age', type: 'numeric' }
  ],
  columnSorting: true
});

Both libraries offer similar basic functionality for creating data grids. UI-Grid is specifically designed for AngularJS, while Handsontable provides a more flexible, framework-agnostic solution. UI-Grid's configuration is typically done through Angular's scope, whereas Handsontable uses a more traditional JavaScript object for initialization. Handsontable offers more advanced features out of the box, but may require additional setup for complex use cases.

28,395

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table

Pros of Table

  • Framework-agnostic, supporting React, Vue, Solid, and more
  • More modern and actively maintained
  • Highly flexible and customizable with a modular architecture

Cons of Table

  • Steeper learning curve due to its flexibility and modular nature
  • Less out-of-the-box functionality compared to UI-Grid

Code Comparison

UI-Grid (AngularJS):

$scope.gridOptions = {
  enableSorting: true,
  columnDefs: [
    { field: 'name' },
    { field: 'age', type: 'number' }
  ],
  data: myData
};

Table (React example):

const table = useReactTable({
  data: myData,
  columns: [
    { accessorKey: 'name', header: 'Name' },
    { accessorKey: 'age', header: 'Age' }
  ],
  getCoreRowModel: getCoreRowModel()
});

Summary

Table offers a more modern, flexible approach to data tables, supporting multiple frameworks and providing extensive customization options. However, it may require more setup and configuration compared to UI-Grid's more opinionated structure. UI-Grid, while older and specific to AngularJS, provides a more complete out-of-the-box solution with less initial configuration required.

React components for efficiently rendering large lists and tabular data

Pros of react-virtualized

  • More flexible and can be used for various virtualized components beyond grids
  • Better performance for large datasets due to efficient rendering
  • Easier integration with React ecosystem and state management

Cons of react-virtualized

  • Steeper learning curve for complex implementations
  • Less out-of-the-box features compared to ui-grid
  • Requires more custom code for advanced grid functionalities

Code Comparison

ui-grid:

$scope.gridOptions = {
  enableSorting: true,
  columnDefs: [
    { field: 'name' },
    { field: 'age', type: 'number' }
  ],
  data: myData
};

react-virtualized:

<Grid
  cellRenderer={({ columnIndex, key, rowIndex, style }) => (
    <div key={key} style={style}>
      {list[rowIndex][columnIndex]}
    </div>
  )}
  columnCount={columnCount}
  columnWidth={100}
  height={300}
  rowCount={rowCount}
  rowHeight={30}
  width={300}
/>

Summary

ui-grid is a feature-rich Angular-based grid solution with a gentler learning curve, while react-virtualized offers more flexibility and better performance for large datasets in React applications. The choice between them depends on the specific project requirements, framework preference, and desired level of customization.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

CI Coverage Status npm License: MIT

Discord Community

UI Grid — 5.x

The modern web data grid for Angular, React, and Web Components. Every feature is free and open source.

Rust, WASM implementation, egui, and native adapter source and documentation live in orneryd/uiGrid.

v5.x + is in use by my other project, NornicDB, in the web ui components (It's a high-performance golang graph+vector database if you want to take a look)

A from-scratch rewrite of the original by the original author. Same gridOptions / columnDefs / onRegisterApi api surface, modern Angular signals internals, and zero legacy baggage.

Just like the original grid, it will NEVER be monetized. This is purely my contribution to the greater community.

It proves that the datagrid cabal wants you to think it's hard to write a data grid. Well, it's not, and nobody should be paying to group data.

Live Demo & Docs | npm | Rust Project | Used by NornicDB


Why Remastered?

  • Original authorship — built by the same engineer who created AngularJS ui-grid, with a decade of hindsight on what worked and what didn't
  • Familiar API — if you used the original ui-grid, you already know this one: gridOptions, columnDefs, onRegisterApi, gridApi.core.*
  • Modern internals — shared vanilla web component core with Shadow DOM encapsulation; Angular and React wrappers are thin bridges that project framework templates into the vanilla element via slot-based portals
  • No legacy — no $scope, no Bower, no Grunt, no jQuery, no module system from 2013

Feature Comparison

Everything below ships free and MIT-licensed. No enterprise tier, no license keys, no per-developer fees.

FeatureUI Gridag-Grid Communityag-Grid EnterpriseVaadin GridKendo UISyncfusion
SortingFreeFree—FreePaidCommunity*
FilteringFreeFree—FreePaidCommunity*
Row GroupingFree—~$999/dev/yr—PaidCommunity*
Tree DataFree—~$999/dev/yrFreePaidCommunity*
Master/Detail RowsFree—~$999/dev/yr—PaidCommunity*
Inline Cell EditingFreeFree—Pro ~$159/dev/moPaidCommunity*
Row SelectionFreeFree—FreePaidCommunity*
Column ResizingFreeFree—FreePaidCommunity*
CSV ExportFreeFree——PaidCommunity*
Excel ExportFree—~$999/dev/yr—PaidCommunity*
PDF ExportFree—~$999/dev/yr—PaidCommunity*
Virtual ScrollingFreeFree—FreePaidCommunity*
PaginationFreeFree—FreePaidCommunity*
Column PinningFreeFree—FreePaidCommunity*
Column ReorderingFreeFree—FreePaidCommunity*
Save/Restore StateFreeFree——Paid—
Infinite ScrollFreeFree—FreePaidCommunity*
Keyboard Cell NavFreeFree——PaidCommunity*
Row Edit (dirty/save)Free—————
Cell ValidationFree—————
CSV/JSON ImportFree—————
Shadow DOMFree—————
Web Component BuildFree——Native——
Feature Tree-ShakingFree—————
SSR SupportFree—~$999/dev/yr———
i18n (6 locales built-in)FreeFree—FreePaidCommunity*
ReactYesWrapperWrapperNoWrapperWrapper
AngularYesWrapperWrapperNoWrapperWrapper
LicenseMITMITCommercialApache/Comm.CommercialComm./Community
Price$0$0~$999/dev/yr$159/dev/mo (Pro)~$799/dev/yrSee below

Bold = features where UI Grid gives you for free what competitors charge for or don't offer at all.

Syncfusion Community license is free for companies with <$1M annual revenue, ≤5 developers, and ≤$3M outside capital. Their paid tier requires a custom quote. Kendo UI ranges $799–$1,299/dev/yr depending on support level. Prices are approximate and subject to change.


Quick Start

npm install @ornery/ui-grid

Angular Component

import { Component } from '@angular/core';
import { GridOptions, UiGridComponent } from '@ornery/ui-grid';

@Component({
  selector: 'app-my-grid',
  imports: [UiGridComponent],
  template: `<app-ui-grid [options]="gridOptions" />`,
})
export class MyGridComponent {
  gridOptions: GridOptions = {
    id: 'my-grid',
    data: [
      { name: 'Alice', role: 'Engineer', salary: 120000 },
      { name: 'Bob', role: 'Designer', salary: 95000 },
    ],
    columnDefs: [
      { name: 'name' },
      { name: 'role' },
      { name: 'salary', type: 'number', align: 'end' },
    ],
    onRegisterApi: (api) => {
      this.gridApi = api;
    },
  };
}

React

npm install @ornery/ui-grid-react @ornery/ui-grid-core @ornery/ui-grid-vanilla
import { UiGrid } from '@ornery/ui-grid-react';
import type { GridOptions } from '@ornery/ui-grid-core';

function MyGrid() {
  const options: GridOptions = {
    id: 'my-grid',
    data: [
      { name: 'Alice', role: 'Engineer', salary: 120000 },
      { name: 'Bob', role: 'Designer', salary: 95000 },
    ],
    columnDefs: [
      { name: 'name' },
      { name: 'role' },
      { name: 'salary', type: 'number', align: 'end' },
    ],
  };

  return <UiGrid options={options} />;
}

Web Components (Vanilla)

The grid's rendering engine is a framework-free custom element (<ui-grid-element>) built on @ornery/ui-grid-core with pure DOM rendering and Shadow DOM encapsulation. Both the Angular and React wrappers are thin bridges around this same element — they mount <ui-grid-element>, pass options, and project framework-specific templates into it via a slot-based portal system.

npm install @ornery/ui-grid-vanilla @ornery/ui-grid-core

No-bundler browser usage is supported by the browser bundle. It includes the core runtime and registers <ui-grid-element> when loaded:

<script type="module" src="./ui-grid-element.js"></script>

<ui-grid-element
  grid-id="static-grid"
  enable-sorting
  enable-filtering
  column-defs='[{"name":"name"},{"name":"role"}]'
  data='[{"name":"Alice","role":"Engineer"}]'
>
</ui-grid-element>

When building from this repo, npm run build:vanilla writes that file to projects/ui-grid-vanilla/dist/browser/ui-grid-element.js. Use that browser bundle for static script-tag consumption; projects/ui-grid-vanilla/dist/index.js is CommonJS and projects/ui-grid-vanilla/dist/index.mjs is the package ESM entry for bundlers or import-map setups.

Declarative HTML usage:

<ui-grid-element
  grid-id="vanilla-demo"
  title="Team Roster"
  enable-sorting
  enable-filtering
  column-defs='[
    { "name": "name" },
    { "name": "role" },
    { "name": "salary", "type": "number", "align": "end" }
  ]'
  data='[
    { "name": "Alice", "role": "Engineer", "salary": 120000 },
    { "name": "Bob", "role": "Designer", "salary": 95000 }
  ]'
>
</ui-grid-element>

<script type="module">
  import { defineStandaloneUiGridElement } from '@ornery/ui-grid-vanilla';

  await defineStandaloneUiGridElement(); // registers <ui-grid-element>
</script>

Supported declarative inputs include boolean flags (enable-sorting, enable-filtering), scalar attributes (grid-id, title, row-height), and JSON attributes (column-defs, data).

For callbacks, function-valued column definitions, or high-frequency updates, use the options property:

import { mountVanillaUiGrid } from '@ornery/ui-grid-vanilla';

await mountVanillaUiGrid(document.getElementById('app'), {
  id: 'mounted-grid',
  data: [{ name: 'Alice', role: 'Engineer' }],
  columnDefs: [{ name: 'name' }, { name: 'role' }],
});

Features

  • Sorting — click column headers to cycle asc/desc/none, custom comparators, programmatic API
  • Filtering — per-column inputs with conditions: contains, exact, startsWith, endsWith, greaterThan, regex, custom predicates
  • Row Grouping — nested multi-column grouping with collapsible group headers
  • Tree View — hierarchical data with expand/collapse per node, arbitrary nesting depth
  • Expandable Rows — master/detail pattern with custom templates (Angular ng-template, React render prop, or vanilla <template> slot)
  • Cell Editing — inline spreadsheet-style editing with full keyboard navigation (Tab, Enter, Escape), edit-on-focus, Enter/Tab commit+move across editable columns
  • Keyboard Cell Navigation — Arrow/Tab/Home/End navigation with wrap/clamp modes, focus persistence across re-renders, keyDownOverrides for custom key handling, full gridApi.cellNav surface
  • Row Selection — click/shift/ctrl/drag-paint mouse selection, keyboard (Space, Ctrl+A), row-header checkbox column, select-all header, isRowSelectable hook, 13 options, 18 API methods, 3 events
  • Column Resizing — drag column borders to resize, programmatic API, persisted via save/restore state
  • Row Edit — dirty/saving/error row lifecycle with rowEditWaitInterval debounce, setSavePromise pattern, auto-retry on error, visual row state indicators
  • Cell Validation — declarative per-column validators (built-in required, minLength, maxLength + custom), async validator support, invalid cell markers with error messages, gridApi.validate surface
  • Pagination — client-side or external pagination with configurable page sizes
  • Infinite Scroll — bi-directional infinite scrolling with loading state management, needLoadMoreData/needLoadMoreDataTop events, full public API
  • Column Pinning — freeze columns left or right with CSS position: sticky, programmatic API, save/restore state
  • Column Moving — HTML5 native drag-and-drop column reordering
  • CSV Export — download visible/selected/all rows with formula-injection protection, full option matrix (separator, header filter, field callbacks, BOM compatibility)
  • Excel Export — ExcelBuilder-compatible sheet data with native numeric/boolean types preserved, configurable filename/sheet/header/custom formatters
  • PDF Export — pdfMake-ready document definition with orientation/page size/styles/header/footer/custom formatter, auto-download when pdfMake is available
  • CSV/JSON Import — file picker or programmatic import, full CSV parser (quoted values, escaped quotes, CRLF), header-to-column mapping, integrates with row-edit for dirty marking
  • Export/Import Menu — buildGridExporterMenuItems() with per-format and per-scope flags, i18n-driven menu labels
  • Virtual Scrolling — virtual scroll viewport, auto-enabled at 40+ rows
  • Save/Restore State — serialize and restore sort, filters, grouping, collapsed groups, pinning, column order, column widths, pagination, selection, focused cell, tree/expandable expansion, and scroll position (per-field opt-in flags)
  • Auto Resize — ResizeObserver-driven viewport height recalculation
  • Custom Cell Templates — Angular ng-template, React cellRenderers map (per-column render functions), vanilla <template> slots with slot-based portal projection
  • Shadow DOM — encapsulated styles with CSS custom property and ::part() hooks
  • Web Component — ships as <ui-grid-element>, a framework-free vanilla custom element (@ornery/ui-grid-vanilla); Angular and React wrappers mount this same element and project templates into it
  • Feature-Flag Builds — compile-time tree-shaking of unused features
  • i18n — 6 locales built-in (English, Spanish, French, German, Japanese, Simplified Chinese), runtime gridApi.i18n for language switching, fallback chain (options.labels → current locale → en-US), register additional locales via gridApi.i18n.add()
  • SSR Support — server-side rendering with platform-safe guards

Theming

The grid renders inside Shadow DOM. Customize it via the public --ui-grid-* CSS custom properties:

.my-app {
  --ui-grid-surface: #1e1b2e;
  --ui-grid-accent: #8b5cf6;
  --ui-grid-header-background: #2d2640;
  --ui-grid-cell-color: #e2e0f0;
  --ui-grid-border-color: rgba(139, 92, 246, 0.2);
  --ui-grid-row-hover: #322e4a;
}

Legacy --app-ui-grid-* aliases remain supported as a fallback for older app themes, but new consumer theming should target only --ui-grid-*.

Target structural elements with ::part():

app-ui-grid::part(header) {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

See docs/theming.md for the full CSS variable reference grouped by grid section, ::part() hooks, and the demo app's 4-mode theme system.


Custom Builds

Ship only the features you use:

# Only sorting and filtering — everything else is tree-shaken
node scripts/build-grid.mjs --features sorting,filtering

# Bake in a locale at build time
node scripts/build-grid.mjs --features sorting,filtering,pagination --locale i18n/fr-FR.json

# See all available flags
node scripts/build-grid.mjs --list

See docs/custom-builds.md for the full feature flag table and build presets.


Documentation

GuideDescription
Getting StartedInstall, minimal setup, run the demo
FeaturesOverview of all features with code examples
ThemingCSS custom properties, ::part() hooks, sample themes
API ReferenceGridOptions, GridColumnDef, UiGridApi
Cell EditingKeyboard navigation, conditional editing, API
Tree ViewHierarchical data, options, API
Expandable RowsMaster/detail, template context, API
Custom BuildsFeature flags, build presets, locale baking
Web ComponentVanilla <ui-grid-element> custom element usage
InternationalizationRuntime overrides, build-time locales
AccessibilityARIA roles, keyboard navigation, screen reader support
Rust ProjectRust/WASM implementation, egui, and native adapters

Interactive versions of all web documentation are also available in the live demo.


Development

npm start          # Dev server at localhost:4200
npm test           # Run tests (Vitest)
npm run build      # Production build
npm run build:library   # Build the library (ng-packagr)
npm run start:vanilla   # Run the framework-neutral browser demo at 127.0.0.1:4174

Compatibility

DependencyVersion
Angular21.2
TypeScript5.9
RxJS7.8
Node22.20
npm11.11

Contributing

Contributions are welcome. Please open an issue first to discuss what you'd like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Run npm test to ensure all tests pass
  4. Submit a pull request

License

MIT

NPM DownloadsLast 30 Days