Boostgrid 2.5.2
dotnet add package Boostgrid --version 2.5.2
NuGet\Install-Package Boostgrid -Version 2.5.2
<PackageReference Include="Boostgrid" Version="2.5.2" />
<PackageVersion Include="Boostgrid" Version="2.5.2" />
<PackageReference Include="Boostgrid" />
paket add Boostgrid --version 2.5.2
#r "nuget: Boostgrid, 2.5.2"
#:package Boostgrid@2.5.2
#addin nuget:?package=Boostgrid&version=2.5.2
#tool nuget:?package=Boostgrid&version=2.5.2
Boostgrid
A modern, framework-agnostic data grid for Bootstrap 5. No jQuery, written in TypeScript, ships ESM + UMD.
- 🎯 Bootstrap 5 native — uses BS5 classes and CSS variables.
- ⚡ Fast — single delegated event listener, memoized derived view, indexed selection lookups, debounced search, virtual scrolling for 10k+ rows.
- 📦 Tiny — ~9 KB brotli core (15 KB hard ceiling); tree-shakeable formatters.
- 🧠 Type-safe —
Boostgrid<TRow>is generic over your row shape. Formatters, callbacks, and footers all inferTRowend-to-end. - 🧩 Framework-friendly — vanilla core +
react-boostgridandvue-boostgridwrappers. Optionalboostgrid-exportplugin for CSV / Excel / Print.
Feature highlights
| Sorting / filtering / search | Multi-column sort, debounced search, custom converters per column |
| Selection | Single + multi, headerless checkbox, getSelectedRows() API |
| Pagination | Top, bottom, both, or rowsPerPage: -1 (all) |
| Virtual scroll | virtualScroll: true — windowed rendering with rAF coalescing |
| Cell edit | editable per column with text / number / select editors, onCellEdit commit hook + revert() for async rollback |
| Row grouping | groupBy + groupAggregators for subtotals; collapse state persisted |
| Multi-level grouping | groupBy: ["status", "region"] for nested headers; colId@N aggregator key targets a specific tier |
| Tree data | treeMode: true with adjacency-list parentId; expand/collapse caret, ancestor-aware search, cycle/orphan defense |
| Frozen columns | frozen: "left" \| "right" per column, sticky positioning with directional scroll-shadow |
| Column reorder + resize | Drag headers to rearrange (frozen-group constrained); drag right edge to resize; both persisted to v:3 state |
| Tree drag-to-reparent | Drop a node onto another to change parentId; cycle-guarded; onReparent callback can veto |
| Master/detail rows | rowDetail: (row) => string \| HTMLElement mounts an expandable panel under each row |
| Cell selection + copy | cellSelection: true for spreadsheet-style range select; Ctrl/Cmd+C copies as TSV |
| Bulk-action bar | bulkActions: (rows) => … renders a sticky toolbar when selection is non-empty |
| Loading skeleton | Animated placeholder rows during ajax fetches (default on; tunable count) |
| Server-side adapters | ajax: true pairs with groupBy + treeMode — request payload carries the active state |
| i18n | Every UI string in options.labels; Intl.NumberFormat for the pagination summary via options.locale |
| Sticky header | stickyHeader: true pins <thead> via pure CSS; coexists with frozen columns |
| Auto tooltips | Truncated cells get a title attribute on hover (truncatedTooltips: true by default) |
| Footer aggregates | footer: true + per-column footerFormatter or whole-row footerCallback |
| State persistence | stateSave: true — sort / search / page / selection / collapsed groups in localStorage |
| Formatters | Built-in linkify, truncate, date, commands, statusBadge, numericRange + your own |
| AJAX | url option for server-side, supports Content-Range-style total count |
Host-page requirements
Boostgrid is a UI component, not a full bundle. The host page must also
load Bootstrap 5's CSS and JavaScript bundle (the toolbar's
page-size picker and column-visibility menu are Bootstrap dropdowns;
without bootstrap.Dropdown they render but never open) plus an icon
font matching the configured icons option — Bootstrap Icons by
default, or Font Awesome when icons: fontAwesomeIcons is set.
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" defer></script>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/boostgrid@2/dist/boostgrid.css">
<script src="https://cdn.jsdelivr.net/npm/boostgrid@2/dist/boostgrid.umd.js" defer></script>
Missing the Bootstrap JS bundle is a silent failure — dropdown buttons
render but never open. Since 2.5.2, Boostgrid emits a console.warn at
first toolbar mount when window.bootstrap.Dropdown is undefined.
Install
# npm
npm install boostgrid
# CDN — use .umd.js (the CDN serves .cjs with `application/node`,
# which modern browsers refuse to execute as a <script>).
<script src="https://cdn.jsdelivr.net/npm/boostgrid@2/dist/boostgrid.umd.js"></script>
<link href="https://cdn.jsdelivr.net/npm/boostgrid@2/dist/boostgrid.css" rel="stylesheet">
# NuGet
Install-Package Boostgrid
Don't forget the host-page requirements above — Bootstrap 5 JS and an icon font are both required.
Quick start
<table id="grid" class="table table-hover" data-toggle="boostgrid"
data-selection="true" data-multi-select="true">
<thead>
<tr>
<th data-column-id="id" data-identifier="true" data-type="numeric">ID</th>
<th data-column-id="sender" data-order="asc">Sender</th>
<th data-column-id="received">Received</th>
</tr>
</thead>
<tbody>...</tbody>
</table>
import { attach } from "boostgrid";
import "boostgrid/style.css";
attach("#grid"); // or rely on data-toggle="boostgrid" auto-init
The full documentation, live examples, and API reference are at the
showcase site (npm run dev).
Framework wrappers
Both wrappers use the same host-div pattern: the wrapper renders an empty
<div>, and Boostgrid builds the <table> imperatively inside it. The
framework's reconciler never fights the grid's DOM mutations. Both expose
the same imperative handle (search, sort, reload, getSelectedRows,
grid escape hatch).
React
import { ReactBoostgrid } from "react-boostgrid";
import "boostgrid/style.css";
export default function Inbox() {
const [rows, setRows] = useState<Row[]>(initial);
return (
<ReactBoostgrid
data={rows}
columns={[
{ id: "id", text: "ID", identifier: true, type: "numeric" },
{ id: "sender", text: "Sender", order: "asc" },
{ id: "subject", text: "Subject" },
]}
options={{ selection: true, stateSave: true }}
onSelected={(rows) => console.log(rows)}
/>
);
}
Vue 3
<script setup lang="ts">
import { ref } from "vue";
import { VueBoostgrid } from "vue-boostgrid";
import "boostgrid/style.css";
const data = ref([{ id: 1, sender: "alpha@x.com", subject: "Welcome" }]);
const cols = [
{ id: "id", text: "ID", identifier: true, type: "numeric" },
{ id: "sender", text: "Sender", order: "asc" },
{ id: "subject", text: "Subject" },
];
</script>
<template>
<VueBoostgrid :data="data" :columns="cols"
:options="{ stateSave: true, selection: true }"
@selected="(rs) => console.log(rs)" />
</template>
Export plugin
CSV, Excel, and Print export ship as a separate workspace package so the core
stays tiny. Excel uses the optional peer dependency xlsx-js-style via a
runtime dynamic import — install it only if you need .xlsx output.
import { attach } from "boostgrid";
import { attachExport } from "boostgrid-export";
const [grid] = attach("#grid");
const exporter = attachExport(grid, { filename: "messages", include: "filtered" });
exporter.csv();
await exporter.xlsx(); // requires xlsx-js-style
exporter.print();
attachExport also adds a delegated click listener for declarative buttons:
<button data-bg-export="csv">Export CSV</button>
<button data-bg-export="xlsx">Export Excel</button>
<button data-bg-export="print">Print</button>
Development
npm install
npm run dev # Vite dev server with the docs site
npm test # Vitest, core (49 specs)
npm run test:all # core + react + export + vue (62 specs)
npm run build # ESM + UMD + d.ts + css to dist/
npm run build:all # core + all three workspace packages
npm run size # bundle-size guard (size-limit, 15 KB ceiling)
Workspace topology
boostgrid/ — core (this package)
├── packages/
│ ├── react-boostgrid/ — React 18+ wrapper
│ ├── vue-boostgrid/ — Vue 3 wrapper
│ └── boostgrid-export/ — CSV / Excel / Print plugin
├── docs/ — showcase site (deployed to GitHub Pages)
└── dist/ — build output (gitignored)
License
MIT — Copyright © Jeffery Leo.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
See https://github.com/JefferyLeo/boostgrid/blob/main/CHANGELOG.md for the full per-version log. v2.5.2 closes a docs gap that was causing silent host-page failures: when Bootstrap's JS bundle isn't loaded, the toolbar's page-size picker and columns-visibility menu render but never open. The toolbar now emits a one-shot console.warn naming the missing dependency, and the docs site + README now spell out the four required host-page loads (Bootstrap CSS, Bootstrap JS, icon font, Boostgrid). v2.5.1 fixed the CDN script-tag MIME issue (.umd.cjs → .umd.js mirror). v2.5.0 introduced element pooling under virtual scroll and the scrollToRow(index) public method. Bundle 16.7 KB brotli, ceiling 18 KB.