npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@smart-grid/core

v1.2.0

Published

Framework-neutral grid state, row processing, filtering, sorting, pagination, and export utilities.

Readme

@smart-grid/core

npm Monorepo / npm release 1.2.0 (stable 1.x).

What's new in 1.2.0

  • column-sizingautoSizeColumns(), resolveFlexColumnWidths(); GridOptions.autoSizeColumns, ColumnDef.flex.
  • column-pinning — sticky pinned columns via buildPinnedCellInlineStyle().
  • accessibility-announcedescribeSortChange(), describeFilterChange().
  • GridOptions: floatingFilters, enableColumnResize; server-side quickFilterText on requests.
  • createExcelWorkbookMulti() and XLSX number-format improvements.
  • See CHANGELOG.md and the monorepo changelog.

Framework-neutral row engine for Smart Grid: sorting, filtering, pagination, selection, grouping, pivoting, tree and master/detail flattening, CSV/Excel helpers, chart specs + SVG rendering hooks, column/context/tool menus, clipboard text, formulas, server-side request shaping, virtualization math, and shared TypeScript types. All UI packages (React, Angular, vanilla) depend on this layer.

Live demo & docs: https://smart-grid-mu.vercel.app/

Use @smart-grid/core directly for unit tests, Node scripts, custom pipelines, or when you only need pure functions and types without mounting a grid.

Install

npm install @smart-grid/core

Usage — process rows in memory

import {
  processGridRows,
  type ColumnDef,
  type SortModel,
  type FilterModel
} from "@smart-grid/core";

type Row = { sku: string; qty: number };

const columns: ColumnDef<Row>[] = [
  { field: "sku", headerName: "SKU", sortable: true, filter: true },
  { field: "qty", headerName: "Qty", sortable: true }
];

const sortModel: SortModel<Row>[] = [{ field: "qty", direction: "desc" }];
const filterModel: FilterModel<Row>[] = [{ field: "sku", value: "A" }];

const processed = processGridRows({
  rowData: [
    { sku: "A-1", qty: 3 },
    { sku: "B-2", qty: 10 },
    { sku: "A-3", qty: 1 }
  ],
  columnDefs: columns,
  sortModel,
  filterModel,
  pagination: true,
  pageSize: 25,
  page: 0
});

console.log(processed.rows); // filtered, sorted, paged view
console.log(processed.totalRows);

Usage — export CSV text

import { exportRowsToCsv, type ColumnDef } from "@smart-grid/core";

const cols: ColumnDef<{ a: number }>[] = [{ field: "a", headerName: "A" }];
const csv = exportRowsToCsv([{ a: 1 }, { a: 2 }], cols);

GridOptions UI config (toolbar, paginationUi)

On GridOptions, optional toolbar (GridToolbarOptions) and paginationUi (GridPaginationOptions) configure built-in toolbar actions and pagination footer in React, Angular, and vanilla adapters. Helpers include buildToolbarButtons, buildPaginationNavButtons, buildPageNumberWindow, and getPaginationRowRange.

Docs: Toolbar & pagination UI.

Public surface (overview)

Exports are grouped by concern (./sorting, ./filtering, ./grouping, ./pivot, ./treeData, ./masterDetail, ./charts, ./excel, ./clipboard, ./menus, ./serverSide, ./virtualization, ./toolbar, ./pagination-ui, ./types, …). Import from the package root; tree-shaking friendly.

Related packages

| Package | When to use | | --- | --- | | @smart-grid/react | SmartGrid in React apps | | @smart-grid/angular | <smart-grid> in Angular apps | | @smart-grid/js | createSmartGrid() in the browser | | @smart-grid/themes | Shared CSS | | @smart-grid/enterprise | Optional license + enterprise helper bundle |

Links

License

MIT