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

@objectifthunes/whiteboard

v0.13.3

Published

Pan/zoom whiteboard canvas with draggable panels, minimap, snap-to-grid, and zoom controls

Readme

@objectifthunes/whiteboard

A pan/zoom whiteboard canvas for React with draggable floating panels, a minimap, snap-to-grid, and a set of themed UI primitives.

Live docs + every export demoed at https://objectifthunes.github.io/whiteboard-demo/.

Install

pnpm add @objectifthunes/whiteboard zustand

Peer dependencies: react >= 18, react-dom >= 18, zustand >= 4.

Quick start

import '@objectifthunes/whiteboard/style.css'
import { WhiteboardShell, FloatingPanel } from '@objectifthunes/whiteboard'

export function App() {
  return (
    <div style={{ position: 'relative', height: '100vh' }}>
      <WhiteboardShell>
        <FloatingPanel title="Hello" defaultPosition={{ x: 100, y: 100 }} focusable>
          Drag me · scroll to zoom · double-click to focus
        </FloatingPanel>
      </WhiteboardShell>
    </div>
  )
}

The shell needs a positioned, sized parent — usually position: relative; height: 100vh (or any explicit height). Auto-fit kicks in on first paint so panels appear pre-framed.

In Next.js (App Router), make the page that hosts <WhiteboardShell> a client component:

'use client'

WhiteboardShell uses ResizeObserver, useEffect, Zustand subscriptions and getBoundingClientRect. For static export, gate first render behind a mounted flag.

Theming

Every component is driven by --wb-* CSS custom properties. Override on :root or scope to [data-theme="dark"]. The package ships sensible defaults.

:root {
  --wb-bg: #f3f4f6;
  --wb-surface: #ffffff;
  --wb-text: #111827;
  --wb-text-muted: #6b7280;
  --wb-border: #e5e7eb;
  --wb-primary: #1f2937;
  --wb-danger: #dc2626;
}

<ThemeToggle theme={…} onToggle={…} /> is controlled — you decide where data-theme lives (almost always <html>).

What's in the package

  • Canvas: WhiteboardShell, FloatingPanel, Minimap, ZoomBar, ConfirmDialog, PanelErrorBoundary
  • Store / hooks: useWhiteboardStore, useWhiteboardLayout, computeWhiteboardFit, computeWhiteboardRectFocus, usePanelRect, belowPanel, snapToWhiteboardGrid, WHITEBOARD_GRID, cn
  • Primitives: Button, ButtonRow, PanelCloseButton, ThemeToggle, OverlayIconButton, Field, Label, Input, Textarea, Select, CoordGrid, CoordInput, Alert, Pill, Chip, TagRow, LoadingState, GeneratingOverlay, EmptyState, Stack, Inline, TitleRow, SplitLayout, IconText, PageShell, PageCard, PageTitle, CardTitle, SectionTitle, SectionDescription, MutedText, ItemCard, ItemList, List, PickerCard, PickerGrid, ChoiceCard, ChoiceGroup, VerticalToolbar, AvatarBadge, CanvasStage, ImageThumb, PanelSection, PanelTitle, Checkbox, Switch, Slider, NumberField, Toolbar, Surface, Tooltip, Kbd, Divider
  • Skeletons: Skeleton, LineSkeleton, TitleSkeleton, ButtonSkeleton, IconButtonSkeleton, InputSkeleton, SelectSkeleton, TextareaSkeleton, ChipSkeleton, ThumbSkeleton, AvatarSkeleton, CanvasSkeleton, PanelFormSkeleton, CardSkeleton, PickerGridSkeleton, ChoiceGroupSkeleton

See the live demo for the full prop reference and copy-pasteable examples per component.

New in 0.5

  • Draggable / DraggableSurface — screen-space dragging for overlay chrome, no WhiteboardShell required. Keep your CSS anchoring; the drag is a translate() delta on top, so layouts stay responsive. Drags from any non-interactive area, snaps to the whiteboard grid on release, honours the global whiteboard-snap-now event, persists per id in localStorage. Double-click resets one element; resetDraggables() resets all.
  • Toolbar reads slightly larger (roomier padding, --wb-fs-md buttons) — it's app chrome, not a panel row.

New in 0.4

Battle-tested additions from building a real app on the kit:

  • Checkbox / Switch — labeled boolean rows; the input pins its own size so host globals can never stretch it.
  • Slider — label left, live readout right, themed range underneath. Returns numbers.
  • NumberField — labeled numeric input; clamps to min/max, never emits NaN.
  • Toolbar — horizontal sibling of VerticalToolbar for app-chrome bars (position="top" | "bottom" | "static", end slot).
  • Surface — the plain floating overlay container (selection menus, legends, log panes) for overlays living outside a WhiteboardShell.
  • Tooltip — CSS-only, shows on hover and keyboard focus. Kbd for shortcut hints, Divider (h/v) for separation.
  • HardeningPickerCard declares its own column layout (the global button style can no longer collapse it into a clipped row); native text/number inputs are now styled like select out of the box.

Build size

42 KB JS raw / ~10 KB gzip, single 30 KB CSS file. No runtime CSS-in-JS.

License

MIT.