Skip to content

JsonView

Stable

Shows a tool call's input or output as a tree you can open level by level, with a copy button.

Also known as json viewer, object inspector, tree view

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Tool input

Search input

The top level is open. The filters object shows its key count until you open it.

When to use it

Lets people read and check the structured data an agent sent to a tool or got back, without reading raw text.

Made of: Header with label · Copy status · Copy button · Scroll region · Tree · Row: open marker, key, value · Show all

Use it for

  • The input and output of a tool call in an agent run.
  • A debug panel that shows a request or response body.
  • Any nested data where people need to open one part and ignore the rest.

Not for

  • Code or a flat block of text to copy: use CodeBlock.
  • Many records with the same fields, to scan and compare: use DataTable.
  • A short summary of a tool call for most readers: use ToolCallCard.

Do and avoid

Search input
Do. The tool's input as a tree people can open level by level.
Search input
Avoid. Secrets and card numbers shown here can be copied by anyone.

Do

  • Name the label after what the data is, not after the tool.
  • Open one level by default and let people open the rest.
  • Lower maxStringLength in a narrow side panel.
  • Put it inside ToolCallCard or a Collapsible when most readers do not need the raw data.

Avoid

  • Do not use it for prose or code. Use CodeBlock.
  • Do not show secrets, tokens or personal data that the reader should not copy.
  • Do not open every level of a large value by default.

On a phone

  • Long values wrap onto more lines instead of running off the screen, and the indent per level is smaller than on wide screens.
  • Rows and the Copy button are at least 44px tall on touch screens. Tapping a row opens it, and tapping a shortened string shows all of it.
  • When the nesting is very deep, the tree scrolls sideways inside its own box, and the page does not.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started