toolbelt

Docs

toolbelt is a developer toolbar you own: one bar for every devtool, installed into your project with shadcn, so you and your agent can read it and change it.

Get started

Paste this into your coding agent. It asks which tools you want, sets up the bar, and suggests tools for your app. Then press ⌘. to hide and show it.

Setup prompt
Set up toolbelt in this project: a dev toolbar from a shadcn registry that gathers every devtool into one bar.

1. It needs shadcn/ui: with no components.json, run `shadcn@latest init`.
2. Find the devtools the project already renders (TanStack Query or Router devtools, React Scan, Redux DevTools, a framework's dev overlay…) and where.
3. Before installing, ask me in one message, then wait:
   - Built-in tools, all four by default: Performance (frame rate, React commits, Web Vitals), Viewport (any device size, real media queries), Screenshot (PNG of the screen or page), Design tokens (colour tokens, copied in any format)
   - Which devtools you found to move into the bar, each with where it's rendered, or that you found none
   - Theme: the app's (default), or the toolbelt's own (shadcn's default, light and dark)
4. Add to components.json: "registries": { "@toolbelt": "https://toolbelt.doddi.dev/r/{name}.json" }
5. With the project's package manager, run shadcn@latest add @toolbelt/toolbelt @toolbelt/toolbelt-settings and the tools I picked: @toolbelt/performance @toolbelt/viewport @toolbelt/screenshot @toolbelt/design-tokens. For its own theme, add @toolbelt/toolbelt-theme too. It all lands in toolbelt/ in the components folder, with its own components in toolbelt/ui/; the project's components/ui is left as it is.
6. Create a client component, DevToolbelt, in that toolbelt/ folder, taking exports and import paths from the installed files. Leave out the tools I didn't pick and their readouts:
<Toolbelt><ToolbeltBar>
  <ToolbeltReadouts>
    <ToolbeltReadout tool="performance" label="Performance"><PerformanceReadout /></ToolbeltReadout>
    <ToolbeltReadout tool="viewport" label="Viewport"><ViewportReadout /></ToolbeltReadout>
  </ToolbeltReadouts>
  <ToolbeltTools>
    <PerformanceTool /><ViewportTool /><ScreenshotTool /><DesignTokensTool />
    <ToolbeltSeparator /><ToolbeltSettings />
  </ToolbeltTools>
</ToolbeltBar></Toolbelt>
   With next-themes, give DesignTokensTool mode={resolvedTheme} onModeChange={setTheme}.
7. Render it last in the root layout's <body>, in development only: {process.env.NODE_ENV === "development" && <DevToolbelt />}
8. For each devtool I picked, render its embeddable panel in a tool in toolbelt/tools/ and remove its floating version, e.g. <ToolbeltTool id="query" label="Query" icon={<DatabaseIcon />}><ReactQueryDevtoolsPanel /></ToolbeltTool>. Leave the others.
9. Suggest a few tools for this app, a line each: feature flags, the user or their role, mock data, the API it talks to, locale… Build none until I pick.
10. Run the typecheck and lint, then tell me what you installed, moved and suggest.

Building a tool, in toolbelt/tools/: <ToolbeltTool id label icon>{content}</ToolbeltTool> gets a button, a window that remembers where it was (display="popover" for quick ones), a place in the settings and the More menu when the bar is full. width and height size it; active dots its button while it changes the page. usePersistedState(key, fallback) keeps state across reloads. A ToolbeltReadout shows a live value in the bar and opens its tool. The panel's content can be anything: the project's own components, or the toolbelt's in toolbelt/ui/ with text-xs to match the built-in tools. Use the project's icon library (iconLibrary in components.json) and theme tokens, never fixed colours, radii or fonts.

How the bar works

A grip to move the bar to any edge of the page, live readouts, a button per tool, and settings at the end.

  • Grip: Drag to any edge
  • Readouts: Live metrics at a glance
  • Tools: Easy access to tools
  • Settings: Configure anything

Hide it and show it

Press Ctrl. anywhere in your app to hide the bar, and again to bring it back, or hide it from the settings. It stays hidden across reloads until you do.

to hide the bar

Built-in tools

Tools for the jobs every app has. Copy a prompt to add one.

  • PerformanceCatch jank, slow renders and layout shifts while you build, not after you ship
  • ViewportSee your app at every screen size without resizing the window or leaving the page
  • ScreenshotGrab a clean shot of any page or component for a pull request, issue or review
  • Design tokensKeep the UI on your design system by seeing which tokens it really uses

They're files in your project, built from the same ToolbeltTool as your own, so you can change them or start a tool from one. They take your theme and icon library, and work together: Screenshot and the token inspector both work inside Viewport's frame.

Put them in the bar beside your own

dev-toolbelt.tsx
<ToolbeltBar>
  <ToolbeltReadouts>
    <ToolbeltReadout tool="performance" label="Performance">
      <PerformanceReadout />
    </ToolbeltReadout>
  </ToolbeltReadouts>
  <ToolbeltTools>
    <PerformanceTool />
    <ViewportTool />
    <ScreenshotTool />
    {/* With next-themes, so its switch goes through it */}
    <DesignTokensTool mode={resolvedTheme} onModeChange={setTheme} />
    <FeatureFlagsTool />
    <ToolbeltSeparator />
    <ToolbeltSettings />
  </ToolbeltTools>
</ToolbeltBar>

Your own tools

The tools worth having are the ones only your app needs. A tool is an id, a label, an icon and your content. It gets a button, a window that remembers where it was, and a place in the settings.

feature-flags-tool.tsx
"use client"

import { FlagIcon } from "lucide-react"

import { ToolbeltTool } from "@/components/toolbelt/toolbelt"

export function FeatureFlagsTool() {
  return (
    <ToolbeltTool id="flags" label="Flags" icon={<FlagIcon />}>
      <FeatureFlagsPanel />
    </ToolbeltTool>
  )
}

Or ask your agent

  • Add a toolbelt tool that overrides our feature flags, with a readout of how many are on
  • Add a toolbelt tool that switches the signed-in user between our roles
  • Add a toolbelt tool that points the app at the local, staging or production API

Popular devtools

Anything that renders a panel fits in a tool, and opens from the bar like the rest. Copy a prompt for your agent: it installs the devtool if it's missing, or moves it into the bar if it's already there.

  • TanStack QueryQueries, their cache and their state
  • TanStack RouterRoutes, matches and loader data
  • React ScanOutlines the components that re-render
  • AgentationNotes on the page for your agent
  • Mock Service WorkerMocked API responses, switched on and off
dev-toolbelt.tsx
import { ReactQueryDevtoolsPanel } from "@tanstack/react-query-devtools"
import { TanStackRouterDevtoolsPanel } from "@tanstack/react-router-devtools"

<ToolbeltTools>
  <ToolbeltTool id="query" label="Query" icon={<DatabaseIcon />}>
    <ReactQueryDevtoolsPanel />
  </ToolbeltTool>
  <ToolbeltTool id="router" label="Router" icon={<RouteIcon />}>
    <TanStackRouterDevtoolsPanel />
  </ToolbeltTool>
  {/* …the built-in tools and yours */}
</ToolbeltTools>