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

tool-grid

v0.1.7

Published

A toggleable grid overlay for design QA — adjust columns, gutters, max-width, and margins in the browser.

Readme

tool-grid

A toggleable grid overlay for design QA. Adjust columns, gutters, max-width, and margins — right in the browser.

Install

npm install tool-grid

Quick Start

Drop in <GridTool /> — no props needed.

import { GridTool } from "tool-grid";
import "tool-grid/styles.css";

function App() {
  return (
    <>
      <YourApp />
      <GridTool />
    </>
  );
}

Press Cmd+G (Mac) or Ctrl+G (Windows/Linux) to toggle visibility.

With custom defaults

<GridTool
  initialConfig={{ columns: 6, gutter: 16, maxWidth: 1280 }}
  position="top-left"
/>

API

<GridTool />

All-in-one component. Renders the grid overlay and controls panel with built-in state management.

| Prop | Type | Default | Description | |---|---|---|---| | initialConfig | Partial<GridConfig> | {} | Initial grid settings | | position | ControlsPosition | "bottom-right" | Panel corner placement | | overlayClassName | string | — | CSS class for the overlay | | controlsClassName | string | — | CSS class for the controls |


Advanced: individual components

For full control over state and rendering, use the pieces directly.

useGridState(initialConfig?)

React hook that manages grid configuration state and visibility.

const { config, setConfig, visible, toggle, setVisible } = useGridState({
  columns: 12,   // default: 12
  gutter: 20,    // default: 20 (px)
  maxWidth: 1440, // default: 1440 (px, 0 = full width)
  margin: 0,     // default: 0 (px)
});

Returns:

| Property | Type | Description | |---|---|---| | config | GridConfig | Current grid configuration | | setConfig | (partial: Partial<GridConfig>) => void | Update one or more config values | | visible | boolean | Whether the overlay is visible | | toggle | () => void | Toggle visibility | | setVisible | (visible: boolean) => void | Set visibility directly |

<GridOverlay />

Renders the column overlay. Non-interactive (pointer-events: none).

| Prop | Type | Default | Description | |---|---|---|---| | columns | number | 12 | Number of columns | | gutter | number | 20 | Gap between columns (px) | | maxWidth | number | 1440 | Container max-width (px, 0 = full) | | margin | number | 0 | Horizontal margin (px) | | visible | boolean | true | Show/hide the overlay | | className | string | — | Additional CSS class |

<GridControls />

Floating panel with sliders and inputs to adjust the grid.

| Prop | Type | Default | Description | |---|---|---|---| | config | GridConfig | — | Current grid configuration (required) | | setConfig | (partial) => void | — | Config update callback (required) | | visible | boolean | — | Current visibility state (required) | | toggle | () => void | — | Toggle callback (required) | | position | ControlsPosition | "bottom-right" | Panel corner placement | | className | string | — | Additional CSS class |

ControlsPosition: "top-left" | "top-right" | "bottom-left" | "bottom-right"

Theming with CSS Variables

Override these custom properties to theme the overlay and controls panel.

Overlay

[data-grid-overlay] {
  --grid-color: rgba(255, 0, 0, 0.1);       /* column fill */
  --grid-outline-color: rgba(255, 0, 0, 0.25); /* column border */
  --grid-z-index: 9999;                       /* stacking order */
}

Controls Panel

[data-grid-controls] {
  --grid-controls-bg: #1a1a1a;        /* panel background */
  --grid-controls-text: #e5e5e5;      /* text color */
  --grid-controls-border: #333333;    /* border color */
  --grid-controls-accent: #3b82f6;    /* active/accent color */
  --grid-controls-input-bg: #2a2a2a;  /* input background */
  --grid-controls-radius: 10px;       /* panel border radius */
}

Example: Blue Grid on Light Theme

[data-grid-overlay] {
  --grid-color: rgba(59, 130, 246, 0.08);
  --grid-outline-color: rgba(59, 130, 246, 0.2);
}

[data-grid-controls] {
  --grid-controls-bg: #ffffff;
  --grid-controls-text: #111111;
  --grid-controls-border: #e5e5e5;
  --grid-controls-input-bg: #f5f5f5;
}

TypeScript

All types are exported:

import type {
  GridConfig,
  GridState,
  GridToolProps,
  GridOverlayProps,
  GridControlsProps,
  ControlsPosition,
} from "tool-grid";

License

MIT