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

markup-board

v0.2.0

Published

A React + Konva drawing and annotation board: freehand, shapes, text, images, groups, pan/zoom, PNG/SVG export with embedded editable source.

Readme

markup-board

A React drawing and annotation board on Konva: freehand, rectangles, ellipses, diamonds, lines and arrows with glue, text, images, groups, an element library, pan/zoom on an infinite (or bounded/fixed) canvas, undo/redo, and PNG/SVG export that can embed the editable board so an exported image re-imports as a live drawing.

The model is a pure reducer (drawReducer) over a plain JSON DrawDoc; the board holds no persistence of its own. You own storage through onChange.

See it running at draw.mar.so (the sketchbook app in this repository).

Install

npm install markup-board react react-dom konva react-konva lucide-react

react/react-dom ≥ 18, konva ≥ 10, react-konva ≥ 18 and lucide-react ≥ 1 are peer dependencies — your app owns their versions. The package is ESM-only and ships TypeScript declarations.

Styling (Tailwind)

The components are styled with Tailwind utility classes over two colour scales, ink and accent. Your Tailwind config must (1) scan the package's compiled files for class names and (2) define those scales — markup-board/theme exports the defaults:

// tailwind.config.ts (Tailwind v3)
import type { Config } from "tailwindcss";
import { boardColors } from "markup-board/theme";

export default {
  content: ["./index.html", "./src/**/*.{ts,tsx}", "./node_modules/markup-board/dist/**/*.js"],
  theme: { extend: { colors: boardColors } },
} satisfies Config;

Supply your own values under the same ink/accent names to restyle the board.

Usage

import { useState } from "react";
import { DrawEditor, type DrawDoc } from "markup-board";

export function Sketch() {
  const [doc, setDoc] = useState<DrawDoc>({ shapes: [], width: 720, height: 460 });
  return (
    <div style={{ height: 600 }}>
      <DrawEditor doc={doc} bgImage={null} name="sketch" onChange={setDoc} />
    </div>
  );
}

DrawEditor fills its container. Useful props:

| Prop | Purpose | |---|---| | doc / onChange | The document, and its debounced live changes (flushed once on unmount). | | session / onSessionChange | Toolbar and selection state, applied once at mount; store it next to the doc. | | features | Capability config (palette width, fills, stroke styling, grouping). Frozen at mount. | | viewport | infinite, bounded to the doc box, or fixed (default: bounded with a bgImage, else infinite). | | library | An element library (entries, onChange, …) shared however the host likes. | | onSave / onCancel | Show the "add as PNG" / discard buttons for attachment-style hosts. | | onNotify, imageToData | Host toast and image-to-raster services. | | boardRef | Imperative BoardHandle — export PNG/SVG, read the doc. | | toolbarExtra | Your own nodes in the toolbar. |

Keyboard shortcuts are bound on the board's own focused element, never on window. markup-board/keymap exports DRAW_KEYMAP, the list to show in a host's shortcut help.

Files

  • exportBoardPng / exportBoardSvg — export, optionally rich (the doc embedded).
  • parseBoardFile, readBoardDocFromPngBytes, readSvgDoc — read a board back from an exported file.
  • renderDocThumbnail — paint a doc off-screen for list thumbnails.

Entry points

| Import | Contents | |---|---| | markup-board | Components, the model (drawReducer, DrawDoc, shapes), viewport math, import/export. | | markup-board/theme | boardColors, BOARD_INK, BOARD_ACCENT — no React, safe in a Tailwind config. | | markup-board/keymap | DRAW_KEYMAP — the shortcut list. |

License

MIT