Dev ToolbarBuilt-in AppsInspector

Inspector

Click any element on the page to jump to its JSX source in your editor, or create rich annotations with context for AI agents.

Last updated:

App ID: dev-toolbar:inspector

The Inspector app lets you interact with any element on the rendered page. Click an element to open its source in your editor, or create an annotation that captures rich context — CSS classes, component names, accessibility attributes, and a screenshot — for bug reports or AI agent consumption.

How it Works

  1. Open the toolbar and activate the Inspector app (the cursor icon).
  2. A floating toolbar appears with mode buttons and tool controls.
  3. In Inspect mode (default): hover to highlight elements, click to see source/a11y info and action buttons.
  4. In Annotate mode: hover to highlight, click to create an annotation directly.

Inspect Mode (default)

Click an element — a popup appears with:

  • Open in editor — jumps to the JSX source in your configured editor
  • Copy HTML — copies the element's outer HTML to the clipboard
  • Copy path — copies the file:line:col source path
  • Copy A11y — copies accessibility attributes as text

Annotate Mode

Click an element — the annotation form opens directly at the click point. See the Annotations app for details.

Keyboard Shortcuts

KeyAction
PToggle animation freeze
HToggle marker visibility
CCopy annotations as Markdown
XClear all annotations
EscClose inspector (or clear multi-select first)
Cmd/Ctrl + hoverDeep select (pierce overlays)
Cmd/Ctrl + Shift + clickMulti-select toggle

Shortcuts are disabled when focused on an input, textarea, or select.

Press Escape or click the Inspector button again to deactivate.

Element Inspection

The Inspector captures detailed information about each hovered element:

DataSource
Element labelHuman-readable name (e.g. button "Submit", link "Home" to /, input[email])
Source locationfile:line:col from data-vdt-source attributes
CSS classesClass list with CSS module hashes cleaned (e.g. class_abc123class)
CSS selectorUnique selector generated for the element (ID → unique class → nth-of-type)
Computed stylesKey CSS properties: display, position, colors, fonts, spacing
AccessibilityARIA role, label, describedby, tabindex, focusable state
ComponentReact/Vue/Svelte component name and stack (see Framework Detection)
DOM pathFull ancestry including shadow DOM boundaries (e.g. body > main > button ⟨shadow⟩)

Shadow DOM Piercing

The Inspector recursively pierces open shadow roots and same-origin iframes to find the actual element under your cursor. This means you can inspect elements inside web components and embedded frames.

Deep Select

Hold Cmd (Mac) or Ctrl (Windows/Linux) while hovering to activate deep select. This skips through invisible overlays, animation wrappers, and empty container divs to reach the actual content element underneath. The highlight border switches to dashed to indicate deep select is active. Uses a two-pass algorithm: text content first, then smallest visible element.

JSX Source Injection

The Inspector relies on data-vdt-source attributes injected into every JSX opening element at build time by the inject-source Vite plugin (part of @visulima/dev-toolbar/vite).

Source injection is enabled by default in development mode and is skipped entirely in production builds.

Configure it via the injectSource plugin option:

devToolbar({
    injectSource: {
        enabled: true,
        ignore: {
            files: ["**/generated/**"],
            components: ["StrictMode"],
        },
    },
});

Source injection reads the original file from disk before transforming, so both SSR and client builds produce identical data-vdt-source values. This prevents React hydration mismatches in SSR frameworks.

Configuring the Editor

By default, launch-editor auto-detects the running editor (WebStorm, VS Code, etc.) from the OS process list.

Per-user override (Settings app): open the Settings app and choose your editor from the "Preferred editor" dropdown. The selection is saved to localStorage and takes priority over the plugin-level default.

Project-level default: set the editor plugin option in your Vite config — this seeds the initial value for all users who haven't made a personal selection:

devToolbar({
    editor: "webstorm",
});

Animation Freeze Mode

When the Inspector is active, you can freeze all page animations to precisely target moving elements. This is particularly useful when annotating elements that are mid-animation or transition.

When frozen:

  • CSS animations pause via animation-play-state: paused
  • CSS transitions are temporarily removed
  • setTimeout / setInterval callbacks are queued and replayed on unfreeze
  • requestAnimationFrame callbacks are queued
  • Web Animations API (WAAPI) animations pause
  • Video elements pause

The toolbar itself is never frozen — elements with the __vdt_ prefix are excluded. Freeze mode survives Vite HMR updates.

Framework Detection

The Inspector automatically detects framework components when hovering elements:

FrameworkDetection MethodWhat's Captured
ReactFiber tree (__reactFiber$)Component name, component stack
Vue__vue_app__ / __vueParentComponentComponent name
Svelte__svelte_metaComponent name

Component names are most accurate in development mode. Minified production builds strip component names.

Multi-select

Two ways to select multiple elements:

Drag selection — drag anywhere (on non-text elements) to draw a rectangle. All elements within are captured as a single annotation. If no elements are found, an "Area selection" annotation is created for the region. The selection samples points within the rectangle, queries nearby elements via CSS selectors, and crosses same-origin iframe boundaries.

Cmd+Shift+Click — hold Cmd/Ctrl+Shift and click elements one by one. Each click toggles the element in/out of the selection group. Selected elements show colored outlines (green for 2+ elements). Release the modifier keys to commit the selection and open the annotation form.

Enabling the Inspector

The Inspector is disabled by default. Enable it in your Vite config:

devToolbar({
    apps: {
        inspector: true,
    },
});

To also enable annotations (recommended):

devToolbar({
    apps: {
        inspector: true,
        annotations: true,
    },
    injectSource: {
        enabled: true,
    },
});

Limitations

  • Cross-origin iframes cannot be inspected due to browser security restrictions. Same-origin iframes are fully supported.
  • Closed shadow roots are opaque — only open shadow roots can be pierced.
  • Framework detection is best-effort in production builds where component names are minified.
  • Screenshot capture requires the Screen Capture API and a user gesture (permission prompt).
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues