🌐 English | 简体中文
TurboGrid is a high-performance JavaScript data grid library with zero dependencies, focused on large-data rendering, rich interactions, and deep customizability.
- High Performance — Virtual rendering handles millions of rows and columns smoothly; row/column caching and lazy loading patterns
- Zero Dependencies — Pure JavaScript, no external runtime dependencies
- Tree Data — Hierarchical rows with expand/collapse, multi-level nesting, and lazy-loading child rows (
setRowSubs) - Frozen Panes — Freeze rows and columns at any edge (top/bottom/left/right) with configurable limits
- Row Operations — Selection (single/multiple), drag & drop reordering, move, add/delete, row numbering
- Sorting & Filtering — Built-in type-aware sorting (string/number/date/boolean), custom comparers, row filtering with keyword highlighting
- Rich Cell Rendering — Formatter system for custom cell content — badges, progress bars, icons, checkboxes, or framework components
- Data Export — Export grid data with configurable column/row inclusion and private field stripping
- Comprehensive API — 100+ methods, 50+ configuration options, and 36 event types covering the full lifecycle
- Touch & Mobile — Built-in touch scrolling, gesture support, and mobile-friendly scrollbar modes
- Themes — Built-in themes (default, lightblue, dark) with deep CSS customization via
className,classMap, andstyleMap - Framework-Agnostic — Works with vanilla JS, Vue, React, Angular, Svelte, or any framework that provides a DOM container
- Quality Assured — 90%+ unit test coverage with 40+ test specs covering rendering, interaction, data operations, and edge cases
npm i turbogrid// ESM
import TG from 'turbogrid';
import { Grid, Util } from 'turbogrid';
// CommonJS
const TG = require('turbogrid');
const { Grid, Util } = require('turbogrid');<script src="dist/turbogrid.js"></script>
<script>
console.log(window.turbogrid);
</script><div id="grid" style="height: 280px;"></div>import { Grid } from 'turbogrid';
const container = document.querySelector('#grid');
const grid = new Grid(container);
grid.setOption({
sortField: 'name'
});
grid.setData({
columns: [
{ id: 'name', name: 'Name' },
{ id: 'value', name: 'Value' }
],
rows: [
{ id: 1, name: 'Row 1', value: 100 },
{ id: 2, name: 'Row 2', value: 200 },
{ id: 3, name: 'Row 3', value: 300 }
]
});
grid.render();TurboGrid provides 100+ public methods, 50+ configuration options, and 36 event types. For the complete and always up-to-date API reference:
https://cenfun.github.io/turbogrid/api.html
The API covers:
- Methods — Data management, row/column CRUD, scrolling & navigation, rendering, selection, tree operations, export
- Options — Display, selection, sorting, frozen panes, scrollbar, performance tuning, theming
- Events — Lifecycle (
onUpdated,onDestroy), interaction (onClick,onSort,onKeyDown), scroll, selection, drag & drop - Data Structures — Column items, row items, and internal properties (
tg_*namespace)
Online docs home: https://cenfun.github.io/turbogrid/
- async
- auto-height
- cache
- loading
- lifecycle
- multiple-instance
- online-render
- performance-test
- resize
- scroll
- scrollbar
- touch
- load-rows
- load-subs
- set-rows
- row-add-delete
- row-collapse
- row-drag
- row-filter
- row-height
- row-hover
- row-move
- row-not-found
- row-number
- row-select
- row-select-group
- row-select-limit
- pagination
- infinite-scroll
- vue-integration
- vue-component
- vue-editor
- custom-element
- React: container-based integration (see Vue / React Integration below)
TurboGrid has built-in mobile support — no extra adapters needed.
- Touch interaction events:
onTouchStart,onTouchMove,onTouchEnd - Touch-friendly scrollbar mode via
scrollbarType: 'auto' - Smooth scrolling and large-data rendering on mobile devices
- Frozen rows/columns work on touch screens
- Combine touch events with
onClick,onMouseWheel, and frozen pane options for hybrid devices
See the live demo for configuration examples: touch
TurboGrid is framework-agnostic — create a grid with a container, update data/options, and call render(). It works the same way in any framework.
This repository includes Vue demos: vue-integration, vue-component, vue-editor.
import { onMounted, onBeforeUnmount, ref } from 'vue';
import { Grid } from 'turbogrid';
const containerRef = ref();
let grid;
onMounted(() => {
grid = new Grid(containerRef.value);
grid.setOption({
bindWindowResize: true
});
grid.setData({
columns: [
{ id: 'name', name: 'Name' },
{ id: 'value', name: 'Value' }
],
rows: [
{ name: 'Row 1', value: 1 },
{ name: 'Row 2', value: 2 }
]
});
grid.render();
});
onBeforeUnmount(() => {
if (grid) {
grid.destroy();
grid = null;
}
});import { useEffect, useRef } from 'react';
import { Grid } from 'turbogrid';
export function GridView() {
const containerRef = useRef(null);
const gridRef = useRef(null);
useEffect(() => {
const grid = new Grid(containerRef.current);
gridRef.current = grid;
grid.setOption({
bindWindowResize: true
});
grid.setData({
columns: [
{ id: 'name', name: 'Name' },
{ id: 'value', name: 'Value' }
],
rows: [
{ name: 'Row 1', value: 1 },
{ name: 'Row 2', value: 2 }
]
});
grid.render();
return () => {
grid.destroy();
gridRef.current = null;
};
}, []);
return <div ref={containerRef} style={{ height: 280 }} />;
}TurboGrid is pure JavaScript — any framework with DOM access and mount/unmount lifecycle works: Angular, Svelte, SolidJS, Lit, Alpine.js, etc. Use the same setData → setOption → render → destroy pattern.
TurboGrid is designed for deep customization at every level:
- Cell Rendering —
setFormatterfor global or per-column custom cell content (HTML, components, badges, icons); built-in formatters for string, number, date, boolean, tree, checkbox - Column Types — Reusable
columnTypeswith per-column overrides for width, alignment, sortability, exportability - Row Behavior — Custom
rowProps,rowFilterfor filtering,rowFilteredSortfor ranked results, tree operations with cross-level drag/move - Events — 36 hookable events for clicks, sorting, dragging, scrolling, keyboard, selection, and lifecycle
- Theming —
theme,className,classMap, andstyleMapat grid, row, and cell level; configurable scrollbar, frozen pane, and hover behavior