Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Debugger Variables Command Menu Block for React

A debugger's variables as a command menu docked at the end beside the code: Local, Closure and Global variables with type words and values, a Step button that advances three typed frames and marks what changed in words with the old value struck, and a changes-only switch.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Watch a value change as you step through code with this debugger variables command menu for React with Base UI. It opens from the Debugger screen of Haltmill, a debugger, whose header holds an outline field with its ⌘ K cap, and the debugger is drawn under a soft scrim inside a hairline frame with a plus mark on each corner: a toolbar whose chip names the line the program has stopped at, and ten lines of code made of shapes with a marker on the current one. The menu is a tall panel at the end of the stage, the catalog Command. Its band shows the frame ("Frame 2 of 3 · line 5"), a Step button, a Reset button and a Switch, Show changes only. Below, the twelve variables are grouped as Local, Closure and Global, each row with its name and value in monospace and its type as a word. Step, or Alt and S, moves the program on through three typed frames: a variable that differs from the frame before says changed in words and shows what it was, struck through, beside the new value, and the marker in the drawn code moves to the line that frame stopped at. Changed is never a colour. Nothing runs and no clock does either: a frame is a step you take. For preview the menu is drawn open in place when the page loads; the field, or Ctrl or ⌘ K while focus is in the block, opens the real command dialog with the same frame, switch and query. For debuggers, REPLs, notebooks and any tool that shows state over time.

FAQ

Why is the menu already open, and what do I keep?

So you can see it without a click. On load the menu is the Command drawn inline at the end of a picture of the debugger, in a plain shell that is not modal, so nothing is trapped, hidden or focused and the page around the preview keeps working. The header's field opens the real command dialog, modal, with its focus trap, Escape and focus return, and the inline copy stays closed until a reload. Both show the same Palette and share the block's state, so the frame you stepped to in the copy is the frame the dialog opens at. In your app keep the dialog and drop the copy: the "in-place" state, the scrim with its shell and the Escape and blur effects.

How do the frames work, and why is there no running clock?

Each variable holds its value for the three frames in an array, and a frame is just an index. Step adds one to it, and everything else is worked out from the index: the values shown, whether a value differs from the one before, the struck-through old value, the count in the foot ("12 variables · 4 changed"), the line in the toolbar chip and the marker in the drawing. The last frame has nowhere to go, so Step stays in place, quiet, and says so; Reset returns to the first. A debugger that ran on a timer would change under a screen reader and under reduced motion, so this one moves only when you press.

How is a change shown without colour?

In words and a strike. The second line of a changed row reads the type and then the word changed in bold, and the end of that line reads "was" and the old value struck through, so the row says what happened to anyone, in any theme. The first frame has no frame before it, so nothing is changed there, and Show changes only is empty with a line that says to press Step.

How do I step from the keyboard?

Alt and S (Option and S on a Mac) steps from anywhere inside the menu, including the search field, and the block reads event.code so Option's characters do not matter; the Step button does the same and is in the tab order. Each step says the frame, the line and how many variables changed, through the status line and, inside the dialog, through the menu's own live region.

What stays local, and how do I wire it?

All of it. The program, its three frames and its twelve variables are typed; nothing is paused, attached to or run. In your app build VARIABLES from the debug adapter's scopes at each stop, take the line from the stack frame, and make Step call the adapter.

Is it accessible from the keyboard?

Yes. Tab reaches Step, Reset and the switch, then the input; type to search by name, value or type, the arrow keys move through the rows, Enter reads the highlighted variable aloud through the status line and Escape closes the menu and puts focus on the field. Ctrl or ⌘ K opens the dialog while focus is inside the block, and only then. The rows are options of a cmdk listbox; the block turns off its own fuzzy filter and lists the rows itself.

How does it look on a phone?

The code goes and the toolbar stays, with its chip. The copy shown on load docks full width under the toolbar, the key hints go and the count stays, and each row keeps its name, value, type and change on two lines. The real dialog keeps the Command dialog's own phone layout.

  • Pro

    A payload inspector's path browser as a command menu shown open beside a value pane: the keys of an object or array with their type as a word, a path bar in monospace, the arrow keys going in and out, a typed path that jumps there, and a copy path button.

  • Pro

    An editor extension's quick fixes as a command menu shown open over the editor: a small code view with flagged lines and numbered line buttons, and a list of only the fixes that apply to the chosen line.

  • Pro

    A design editor's command menu shown open at the end of the editor: twelve things done in four time buckets, type chips that filter them, choosing an entry reverts it and the drawn layer list follows, and Clear history asks before it clears.

  • Pro

    A database admin's table finder as a command menu shown open beside a schema pane: a switch between a read-only Production and a Staging connection, tables with their row counts, and a pane of the highlighted table's columns with a Copy SELECT button.

  • Pro

    A localisation platform's string finder as a command menu shown open under a band of language chips with their coverage: keys with their text in the chosen language or the word Missing, a Missing only switch and a copy key button.

  • Pro

    An agency billing portal's account switcher as a command menu shown open under the account chip: four accounts with initials, role and plan, a tick on the current one, the keys 1 to 4 to switch straight to an account, and the chip and status line that follow the choice.