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

@chris-corby/dev-overlay

v0.1.0

Published

Development grid overlay and spacer web components with Shadow DOM isolation

Downloads

142

Readme

dev-overlay

A collection of useful web components for checking visual layout in the browser.

To test them out, visit the live demo.

dev-overlay screenshot

Installation

Download

Either download a release directly or install it from npm:

npm install --save-dev @chris-corby/dev-overlay

Register

1) Auto Method

Fastest setup. Registers all three components under their default tag names. This can be done in JavaScript or in HTML.

a) In JavaScript
import "@chris-corby/dev-overlay/auto";
//  Direct import path would be: "[PATH]/dist/auto.js";
b) In HTML
<script type="module" src="[PATH]/node_modules/@chris-corby/dev-overlay/dist/auto.js"></script>
<!-- Direct src would be: "[PATH]/dist/auto.js" -->

2) Explicit Method

Use this if you want custom tag names (for example, to avoid collisions with another library) or want to tree-shake components you don’t use.

import { DevBaseline, DevGrid, DevSpacer } from "@chris-corby/dev-overlay";
//  Direct import path would be: "[PATH]/dist/index.js";

//  Default Naming
customElements.define("dev-baseline", DevBaseline);
customElements.define("dev-grid", DevGrid);
customElements.define("dev-spacer", DevSpacer);

//  Custom Naming
customElements.define("my-project-grid-overlay", DevGrid);
// ...

Render

Render the elements wherever you want them available.

<dev-grid></dev-grid>
<dev-baseline></dev-baseline>
<dev-spacer></dev-spacer>

[!TIP] Consider only registering the components in your dev environment – they’re likely not needed in production.

Usage

Components are visible on the page when they have the active attribute. This is toggled with keyboard shortcuts. All shortcuts must start with Ctrl + Shift but the letter can be changed by setting the trigger attribute. Here are the defaults:

| Shortcut | Action | | ------------------ | ------------------- | | Ctrl + Shift + G | Toggle the grid | | Ctrl + Shift + B | Toggle the baseline | | Ctrl + Shift + S | Toggle the spacer |

The following grid element would be visible on load and triggered with Ctrl + Shift + W:

<dev-grid active trigger="w"></dev-grid>

The trigger value is case-insensitive so trigger="w" and trigger="W" are equivalent.

Customization

Elements can be customized to fit your project with either CSS custom properties or HTML attributes. If both are present, attributes win.

I (Chris) tend to prefer CSS custom properties as they play nicely with other project variables and media queries. For example, in the example below I already have my project grid defined and it changes responsively. I set up <dev-grid> to match:

:root {
  --columns: 4;
  --margin: 1rem;

  --dev-grid-columns: var(--columns);
  --dev-grid-margin: var(--margin);
}

@media (min-width: 800px) {
  :root {
    --columns: 12;
    --margin: 1.5rem;
  }
}

[!WARNING] CSS Resets – If your project uses an aggressive CSS reset (e.g. all: unset), exclude the overlay elements to prevent overriding their shadow-DOM host styles: :not(dev-grid, dev-baseline, dev-spacer).

<dev-grid> Options

| HTML Attribute | CSS Custom Property | Type | Default | Description | | -------------- | ----------------------- | ------------------- | -------------------------- | --------------------------------------------------------- | | active | (attribute only) | boolean attribute | off | Reveals the element | | columns | --dev-grid-columns | integer | 12 | Number of grid columns | | gap | --dev-grid-gap | <length> | 1rem | Gap between columns | | margin | --dev-grid-margin | <length> | 1rem | Horizontal margin outside the grid container | | max-width | --dev-grid-max-width | <length> | 100rem | max-width of the grid container. It centers beyond this | | color | --dev-grid-color | <color> | hsl(240 100% 50% / 0.25) | Column fill color | | blend-mode | --dev-grid-blend-mode | <blend-mode> | hard-light | mix-blend-mode of the grid to aid clarity | | trigger | (attribute only) | single letter (a–z) | g | Letter key used with Ctrl + Shift | | z-index | --dev-grid-z-index | integer | 10000 | z-index stacking order |

<dev-baseline> Options

| HTML Attribute | CSS Custom Property | Type | Default | Description | | -------------- | ------------------------ | ------------------- | ------------------------ | ----------------------------------- | | active | (attribute only) | boolean attribute | off | Reveals the element | | spacing | --dev-baseline-spacing | <length> | 1rem | Gap between lines | | color | --dev-baseline-color | <color> | hsl(0 100% 50% / 0.25) | Line color | | trigger | (attribute only) | single letter (a–z) | b | Letter key used with Ctrl + Shift | | z-index | --dev-baseline-z-index | integer | 10001 | z-index stacking order |

<dev-spacer> Options

| HTML Attribute | CSS Custom Property | Type | Default | Description | | -------------- | ------------------------ | ------------------- | ----------------------- | ----------------------------------- | | active | (attribute only) | boolean attribute | off | Reveals the element | | width | --dev-spacer-width | <length> | 2rem | Initial spacer width | | height | --dev-spacer-height | <length> | 2rem | Initial spacer height | | color | --dev-spacer-color | <color> | hsl(0 100% 50% / 0.5) | Spacer fill color | | font-size | --dev-spacer-font-size | <length> | 10px | Font size of the measurement label | | trigger | (attribute only) | single letter (a–z) | s | Letter key used with Ctrl + Shift | | z-index | --dev-spacer-z-index | integer | 10002 | z-index stacking order |

Interactions

| Action | Effect | | --------------------------------- | ---------------------------------- | | Drag | Move the spacer | | Shift + drag | Lock movement to the dominant axis | | Arrow keys | Nudge by 1px | | Shift + arrow | Nudge by 10px | | Alt + arrow | Resize by 1px | | Alt + Shift + arrow | Resize by 10px | | Escape | Reset position and size | | Double-click | Reset position and size | | Native bottom-right resize handle | Resize with the browser handle |

Styling the Spacer Label

The spacer’s measurement label is exposed as a shadow part, so you can customise it further with your own rules. For example, to change the font-size:

dev-spacer::part(label) {
  font-size: 14px;
}

Browser Support

Any evergreen browser (Chrome, Edge, Firefox, Safari). No build step or polyfills needed.

Development

git clone https://github.com/chris-corby/dev-overlay.git
cd dev-overlay
npm install
npm run dev
npm run build
npm run typecheck

Contributing

Issues and pull requests welcome — see GitHub Issues.

License

MIT © Chris Corby