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

@devslab/dds-table-react

v0.29.2

Published

DDS themed Community AG Grid for React

Readme

@devslab/dds-table-react

DDS styling and an SSR-safe React boundary for AG Grid Community 36.2.0. This package is independent of @devslab/dds-react; importing React primitives does not import AG Grid. React and React DOM 18.3 or 19 are peers.

import { useRef } from "react";
import { DataTable, type DataTableRef } from "@devslab/dds-table-react";
import type { ColDef, ICellRendererParams } from "ag-grid-community";
import "@devslab/dds-tokens/tokens.css";
import "@devslab/dds-css/dds.css";
import "@devslab/dds-table-react/styles.css";

type Order = { id: string; amount: number };
const columns: ColDef<Order>[] = [
  { field: "id", filter: true },
  { field: "amount", editable: true,
    cellRenderer: ({ value }: ICellRendererParams<Order, number>) => <strong>{value}</strong> },
];
export function Orders({ rows }: { rows: readonly Order[] }) {
  const gridRef = useRef<DataTableRef<Order>>(null);
  return <DataTable rows={rows} columns={columns} label="Orders"
    placeholder="Preparing orders" gridRef={gridRef}
    gridProps={{ getRowId: ({ data }) => data.id, rowSelection: { mode: "multiRow" },
      onGridReady: ({ api }) => console.log(api.getDisplayedRowCount()),
      localeText: { noRowsToShow: "No orders" } }} />;
}

rows accepts immutable array references and copies the array for AG Grid. Replace the array when data changes; keep columns and native configuration stable when practical. columns is native ColDef<T>[], including React cell renderers. label is required and names both the enclosing region and the mounted grid. All copy and translations belong to the caller; pass localeText for AG Grid's built-in UI.

gridProps is the exported DataTableGridProps<T> alias for native AgGridReactProps<T>, excluding rowData and columnDefs. It accepts AG callbacks, editing/selection/filter options, custom renderers, gridOptions, modules, and themes. DDS defaults are local AllCommunityModule, sortable/resizable columns with minWidth: 120, and ddsGridTheme. Direct native properties override equivalent gridOptions values. Custom module sets must include modules required for their features and RenderApiModule for the required accessible label. DDS does not globally register modules or add selection/filtering/editing beyond native options.

gridRef is a normal React ref to AgGridReact<T>; access gridRef.current.api after onGridReady. It supports object refs and callback refs, including React 19 ref cleanup. The component's ref points to its enclosing HTMLDivElement. DOM props (id, className, style, event handlers) apply to that region.

density defaults to "comfortable" (40px rows, 44px headers); "dense" uses 32px rows and 36px headers. Explicit native rowHeight/headerHeight override density. Default height is 480px; use style={{ height: 640 }} to change it. The grid fills available width and retains minimum column widths, using AG Grid's horizontal scrolling on narrow screens. Choose native domLayout and container dimensions together if changing its layout.

The exported ddsGridTheme maps semantic DDS CSS variables to AG Grid's supported theme parameters. It follows the closest DDS token scope, including [data-theme="dark"]. Override with gridProps.theme, gridProps.gridOptions.theme, or ddsGridTheme.withParams(...). AG Grid generates its own theme CSS; do not load legacy AG Grid CSS alongside this default theme. AG Grid theme parameters support CSS variable color expressions.

SSR and worker imports are browser-global safe. Server rendering and the first hydration render emit the same named role="region" placeholder with aria-busy="true", a stable height, and optional caller-provided placeholder. A React effect then mounts AG Grid. Server markup contains no rendered grid rows or HTML table; provide a separate server summary if the page requires one. Native loading marks the mounted region busy and drives AG Grid's loading overlay. Empty arrays use AG Grid's native empty state. In React Server Component frameworks, use this component within a client component.

Community sorting, filtering, resizing, editing, selection, virtualization, and the infinite row model remain AG Grid behavior. The default client-side row model processes only the supplied rows: it cannot sort/filter an entire remote result when rows is one loaded page. For remote data, choose the Community infinite row model with a datasource and implement remote sorting/filtering in its getRows handler. Pass rows={[]} and configure the native datasource; rows/columns remain DDS-owned inputs. The Enterprise server-side row model, grouping, pivoting, and other commercial features are not bundled. Consumers who separately install/register Enterprise modules own their license and integration. AG Grid row models documents these boundaries.

Published ESM, declarations, and the explicit CSS export contain no Solid runtime dependency. DDS's source-available license is in LICENSE; AG Grid Community has its own MIT license.