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/react

v1.2.0

Published

React wrapper for Smart Grid.

Downloads

357

Readme

@smart-grid/react

npm Monorepo / npm release 1.2.0 (stable 1.x); depends on @smart-grid/core ^1.2.0.

What's new in 1.2.0

  • floatingFilters, autoSizeColumns, enableColumnResize — parity with Angular (resize handles, auto-width on load).
  • Tool panel collapsed by default, right-side layout; header filters (text / set / number / date); aria-live announcements.
  • Sticky column pinning and cellRenderer HTML. See CHANGELOG.md.

React component and hooks for Smart Grid, built on @smart-grid/core. Same capabilities as the Angular adapter: sorting, filtering, pagination, selection, grouping, pivot, tree, master/detail, charts, CSV/Excel, tool panel, find, range selection, and optional virtual scroll.

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

Works with React 18+ and React 19. Import @smart-grid/themes CSS once for polished light/dark layouts.

Install

npm install @smart-grid/react @smart-grid/themes
# Peer deps: react, react-dom ^18 || ^19

Usage — SmartGrid

// App.tsx
import { useState } from "react";
import { SmartGrid, type ColumnDef } from "@smart-grid/react";
import "@smart-grid/themes/smart-grid.css";

type Row = { id: string; product: string; units: number };

export function App() {
  const [rows] = useState<Row[]>([
    { id: "a", product: "Sensor", units: 40 },
    { id: "b", product: "Gateway", units: 12 }
  ]);

  const columns: ColumnDef<Row>[] = [
    { field: "product", headerName: "Product", sortable: true, filter: true },
    { field: "units", headerName: "Units", sortable: true }
  ];

  return (
    <SmartGrid<Row>
      rowData={rows}
      columnDefs={columns}
      pagination
      pageSize={10}
      rowSelection="multiple"
      theme="smart-light"
      showToolPanel
      onSelectionChanged={(selected) => console.log("Selected:", selected)}
      onCsvExport={(csv) => console.log("CSV length:", csv.length)}
    />
  );
}

Usage — useSmartGridFeatures

Expose the same pure helpers as the vanilla createSmartGrid().features API (grouping, pivot, charts, clipboard, menus, …) inside React components or hooks — useful for custom panels, tests, or server-side prep.

import { useSmartGridFeatures } from "@smart-grid/react";

export function FeaturePanel() {
  const f = useSmartGridFeatures();
  const spec = f.charts.createChartSpec(
    [{ region: "North", sales: 100 }],
    { type: "bar", categoryField: "region", valueField: "sales" }
  );
  return <pre>{JSON.stringify(spec, null, 2)}</pre>;
}

Toolbar & pagination UI

Pass toolbar and paginationUi on <SmartGrid> (same types as GridOptions in core). Control icon vs text display, per-button overrides, and pagination nav / page window size.

<SmartGrid
  toolbar={{ buttonDisplay: "both", buttons: { clear: { label: "Reset" } } }}
  paginationUi={{ buttonDisplay: "icon", maxPageButtons: 5 }}
  pagination
  pageSize={10}
  rowData={rows}
  columnDefs={columns}
/>

Docs: Toolbar & pagination UI.

API — SmartGrid props (high level)

The component accepts grid options from @smart-grid/core (rowData, columnDefs, pagination, serverSide, dataSource, pivot/tree/master-detail fields, chart fields, toolbar, paginationUi, etc.) plus React-oriented callbacks:

| Prop | Role | | --- | --- | | onSelectionChanged | Fires with selected row objects. | | onCellValueChanged | Cell edits. | | onCsvExport | CSV string from toolbar export. | | onColumnOrderChanged / onRowOrderChanged | Drag reorder results. | | onRangeSelectionChanged | Current CellRange or null. | | groupBy, aggregations | Grouped rows. | | enableRangeSelection, showColumnMenus, showContextMenu, showToolPanel | UI toggles. |

Full typings ship in SmartGridProps<TData>.

Related packages

Links

License

MIT