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
- Webhook payload
- API response
- Tool call result
- Event log entry
- Config review
Examples
Thousands of lines
Broken JSON
Diff two versionsPro
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
Schema hintsPro
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-inspectorPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install JSON inspector from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/json-inspector
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add json-inspector
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- components/ui/knowns/kbd.tsx
- components/ui/knowns/field-class.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/json-inspector/json-inspector.tsx
- components/ui/knowns/json-inspector/json-inspector-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/json-inspector, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "json-inspector" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.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- Default
2 - Levels open on first render. A new value resets the tree to this.
- height
number- Default
360 - 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- Default
true - 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- Default
false - 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| 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 | 2 | Levels open on first render. A new value resets the tree to this. |
| height | number | 360 | 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 | true | The search field with a match count and next and previous. |
| pathRoot | string | "" | 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 | false | 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).
| Key | Where | Does | |
|---|---|---|---|
| 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
- 01Shows one JSON value as a tree with indent guides and type colours, open two levels deep, with a size on every shut container.
- 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.
- 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.
- 04Moves like a file tree: arrows, Home and End, right to open and step in, left to close and step out.
- 05Renders only the rows in view, so a payload of 5,000 items scrolls as a short one does.
- 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
| State | What moves | Timing |
|---|---|---|
| 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
- One tool call with its arguments and result: use Tool Call Card.
- Code or a command to copy: use Code Block.
- A diff of code or prose: use Inline Diff.
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" }).