Skip to content

JSON Inspector

Read, search and quote JSON: webhook bodies, API responses and tool results. A tree that folds at any level, a search across keys and values with next and previous, Copy path and Copy value for the focused node, full keyboard control and a list that stays fast at thousands of lines. Text that does not parse shows where it breaks. The Pro layer adds a diff of two versions and schema hints.

On this page
Used for
  • Webhook payload
  • API response
  • Tool call result
  • Event log entry
  • Config review

Examples

Open levels
Path prefix

Thousands of lines

Broken JSON

Problem

Diff two versionsProPro

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Schema hintsProPro

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Installation

npx knowns-ui@latest add json-inspector
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

value
unknown
A parsed value. Takes precedence over text.
text
string
Raw JSON. Text that does not parse shows the broken state with the line and column.
defaultExpandDepth
number
Default2
Levels open on first render. A new value resets the tree to this.
height
number
Default360
Height of the tree in px. The list scrolls inside it and shrinks for a short value.
label / meta
ReactNode
A name for the payload and something after it, such as a status or a size.
searchable
boolean
Defaulttrue
The search field with a match count and next and previous.
pathRoot
string
Default""
A prefix for copied paths: "$" gives $.data.items[0].
onCopy
(what: "path" | "value", text) => void
After a copy from the footer or the c and p keys.
onFocusPath
(path: (string | number)[]) => void
The focused node changed.
decorate
(row) => { after?, tone? }
Content at the end of a row and an error or warning tint. The schema hints use it.
banner
ReactNode
Content between the toolbar and the tree.
bare
boolean
Defaultfalse
No outer card, for your own panel.
JsonDiff (Pro)
before, after, beforeText?, afterText?, beforeLabel?, afterLabel?, arrayKey?, defaultOnlyChanges?
Two versions as one tree. arrayKey matches list items by a key instead of by position.
JsonSchemaInspector (Pro)
schema, showTypes?, ...JsonInspector props
Expected types and descriptions from a JSON Schema; values that do not fit and missing required keys are marked and counted.
Up / Down, Home / End
Tree
Move the focus.
Right / Left
Tree
Open, or step into the first child. Close, or step out to the parent.
Enter / Space
Tree
Open or close the focused node.
* (star)
Tree
Open everything.
c / p
Tree
Copy the value or the path of the focused node.
/ (slash)
Tree
Go to the search field.
Enter / Shift+Enter
Search
Next or previous match. Esc clears; Esc again goes back to the tree.
n / Shift+n
Diff
Next or previous change (Pro).

What it handles

  1. 01Shows one JSON value as a tree with indent guides and type colours, open two levels deep, with a size on every shut container.
  2. 02Searches keys and values across the whole document, not only what is open, opens what hides the match and steps with Enter and Shift+Enter.
  3. 03Copies the focused node's path as code would write it (data.items[0].id) or its value, from the footer or with p and c.
  4. 04Moves like a file tree: arrows, Home and End, right to open and step in, left to close and step out.
  5. 05Renders only the rows in view, so a payload of 5,000 items scrolls as a short one does.
  6. 06Shows where broken JSON breaks: a plain message, the line and column, and the lines around it with a mark.

States

First render
Nothing moves. The tree paints open to its depth
none
Open a node
The chevron turns; the rows it reveals settle in
120ms, ease out, opacity only
Close a node
The rows go at once; the chevron turns back
120ms, ease out
Search, next or previous
Focus jumps to the match and the list scrolls to it
none
Copy
The icon becomes a check and the label reads Copied
180ms pop, rare
Reduced motion
Every change lands at once
0ms

Works with

When to use

When to use

  • Reading a webhook body, an API response or a tool result: fold it, search it and copy the path or value you need.
  • Comparing two versions of a payload or a config to see exactly what changed (Pro).
  • Checking a payload against its JSON Schema while you debug an integration (Pro).

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI JSON Inspector to my app and wire it to my own data.
  • I need reading a webhook body, an API response or a tool result: fold it, search it and copy the path or value you need. Set that up with the Knowns UI JSON Inspector.
  • Which JSON Inspector props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "json-inspector" }) and search_docs({ query: "json inspector" }).

Need help?

Stuck on JSON Inspector, or found something off? We read every message.