The bar in your dev server
The npm package for Astro and Next.js.
For Astro and Next.js projects, the notemend npm package puts the bar in your dev server — only under npm run dev, never in a production build. It is the same bar as on a live site, with a designer's tools around it.
npm i -D notemend && npx notemend initinit wires the bar in (Astro: the integration in astro.config; Next.js: a client loader, a route and transpilePackages), finds your breakpoints in the CSS, lists your pages and writes notemend.config.mjs. --yes takes every default.
What the dev bar adds
- Inspectors — spacing, size and type in design pixels, with WCAG contrast for text; color (O): the fill and the text colour; and border & radius (B): the border on each side, its colour and the radius of each corner — every colour named by the CSS variable it was written with (“≈” when only its value matches one, as with a stylesheet from another domain).
- Contrast (K) — point at text: its colour and what is behind it, the ratio, and WCAG's three checks (AA 4.5:1 body, 3:1 large, AAA 7:1); when it fails for its size, the nearest colour of the same hue that passes — a click copies it. An empty field is measured by its placeholder.
- Vision (V) — the view as people with other eyes see it: a snapshot of the window shown six ways (normal, greyscale, low vision, deuteranopia, protanopia, tritanopia); a click puts that filter on the page, under the bar, until Esc. When the page cannot be drawn it opens as a plain list of the modes.
- Customize the bar (gear menu) — hide the inspectors and screen sizes you never use, or bring them back; kept by this browser. Comments, the panel and the rest of the bar always stay.
- A layout grid over the page: Auto reads the page's own columns and gap (a chip says what it found); Custom draws the project's columns, gutter, margin and width for each screen size — set in the project's settings or the bar's gear menu › Grid, the same for everyone.
- A breakpoint canvas — every width side by side — and device previews in real frames.
- The top strip — a 40 px line across the top of the page: your studio and the space (Team or Client) on the left; the page's address in the middle with its open threads per screen size; you, settings and the pin on the right. It stays out of the way: a small grip at the top edge is all you see, and the strip slides out over the site when the pointer rests at the top edge, when you tap the grip or press ⇧\; it leaves when the pointer does. Nothing on the site moves. The pin keeps the strip out and moves the site down under it. The bar at the bottom keeps the tools.
- The page list — click the address: every page from your routes with its threads, a search over the pages, the link icon to copy the page's address, and your own folders; pages in none of them are one list under them. The project's admins (or you, on a site kept on your computer) make, rename — a double click — and ungroup folders, add pages and drag them in and out, or pick pages with ⌘-click / Shift-click and group them with ⌘G (⌘⇧G ungroups); everyone sees them, and which ones are open stays yours.
- Sanity (E, with
sanity: true) — hides Sanity's visual-editing overlay while you comment or measure. - Edits without the blink (Astro) — when you or an agent change a page's markup, the change lands in the open page instead of reloading it: the site's intro doesn't replay, a video keeps playing, the bar and its open card stay put. A changed script still reloads the page; after any reload the card you had open opens again.
- Live — each open tab keeps a line to the dev server (
/__devbar/events): a reply, a fix or the agent taking a thread shows at once, from the CLI, an agent or a teammate in a linked project. For a linked project the dev server asks the cabinet what changed every 1.5 s while you work on the page and every 5 s while the tab only stands open, and keeps a copy of the project for your tabs (and on disk, for the next start).
The config
notemend.config.mjs sets the breakpoints, the preview devices, the pages and their groups (null leaves a page out), the grid's container and columns, the elements the bar leaves alone (ignore) and its zIndex; it is read again on every page load, no restart. The package's README lists every option.
Where comments go
To the cabinet project the site is linked to, on localhost too — shared with the team and the live site's bar. The bar needs an account: run npx notemend login and npx notemend link <project-id> in the site's folder. Signed out or unlinked, the bar does not show and the dev server's terminal says which of the two to run.