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

the-burger

v3.0.1

Published

Burger is a minimal hamburger menu with fullscreen navigation.

Readme

Burger

Burger is a minimal hamburger menu with fullscreen navigation. One stylesheet, about forty lines of JavaScript, no runtime dependencies.

Demo

Screenshots

Burger: Closed

Burger: Opened

Quick start

npm install the-burger

Or from a CDN:

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/the-burger@3/dist/css/burger.min.css"
/>
<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/the-burger@3/dist/scripts/burger.min.js"
></script>

The script is an ES module, so it needs type="module". It wires up every .b-menu on the page when it loads. To control that yourself:

import { initBurger } from "the-burger";

const teardown = initBurger(document.querySelector(".b-menu"));

Markup

The toggle is a <button> with aria-expanded and aria-controls, and the navigation is a <nav> around a <ul>. Both matter: aria-expanded is the only state the component has, and the stylesheet derives everything else from it.

<nav class="b-nav" id="b-nav" aria-label="Main">
  <ul>
    <li><a class="b-link b-link--active" href="#" aria-current="page">Home</a></li>
    <li><a class="b-link" href="#">About</a></li>
    <li><a class="b-link" href="#">Portfolio</a></li>
    <li><a class="b-link" href="#">Contact</a></li>
  </ul>
</nav>

<div class="b-container">
  <button
    class="b-menu"
    type="button"
    aria-expanded="false"
    aria-controls="b-nav"
    aria-label="Open menu"
  >
    <span class="b-bun b-bun--top"></span>
    <span class="b-bun b-bun--mid"></span>
    <span class="b-bun b-bun--bottom"></span>
  </button>

  <a href="#" class="b-brand">Burger</a>
</div>

You get keyboard operation, Escape to close with focus returned to the toggle, closing on navigation, a scroll lock while open, and a closed menu that stays out of the tab order. While the menu is open the rest of the page is inert, so Tab cycles inside the navigation instead of wandering into content behind the overlay. Forced-colors modes are handled, and the whole thing is viewport-anchored, so it works the same at the bottom of a long page as at the top.

Theming

Every value is a --burger-* custom property. Redeclare the ones you want:

:root {
  --burger-accent: #111;
  --burger-on-accent: #fff;
  --burger-size: 48px;
  --burger-font-family: "Inter", sans-serif;
  --burger-duration: 0.25s;
}

Sizes derive from each other, so overriding --burger-size moves the bars, the cross, and the navigation offset together.

Burger's rules live in @layer burger.tokens, burger.overlay, burger.menu, burger.nav. Layered CSS loses to unlayered CSS regardless of specificity, so any rule you write in your own stylesheet wins without !important.

Motion sits inside @media (prefers-reduced-motion: no-preference); readers who ask for less motion get the menu with no transitions or slide-in.

Development

npm install
npm run build      # src/ -> dist/ (Lightning CSS + esbuild + tsc declarations)
npm test           # lint, format, types, unit tests, build, publint, attw
npm run build:site # writes site/burger/ for hosting at blode.co/burger

The source is TypeScript and ships generated declarations, so initBurger is typed for importers.

dist/ is committed because CDN and npm consumers load it directly. Rebuild after touching anything in src/; CI fails if the two disagree. See AGENTS.md for the architecture conventions.

Browser support

Burger uses cascade layers, :has(), and logical properties. Chrome and Edge 123+, Firefox 128+, Safari and iOS Safari 17.5+.

Contributing

Pull requests are the way to go. Add a changeset with npm run changeset.

Creators

Matthew Blode

License

MIT © Matthew Blode