JSON view

Shows structured data as a foldable tree.

Toolbar

  • {
    "run": "run_8f2a91",
    "pipeline": "ingest-events",
    "status": "failed",
    "region": "eu-west-2",
    "partitions": [
    "error": {
    "step": "extract",
    "code": "NoSuchKey",
    "message": "The object lake://lake/events/2026-10-18T12/part-0000.parquet was not found. Th…
    "warehouse": null
    Path$

    truedefault

  • events_daily
    {
    "table": "events_daily",
    "rows": 1204330,
    "bytes": 98234112,
    "partitioned_by": [
    0: "day",
    1: "region"

    false

States

  • {
    "table": "events_daily",
    "rows": 1204330,
    "bytes": 98234112,
    "partitioned_by": [
    0: "day",
    1: "region"

    open

  • folded

  • {
    "step": "extract",
    "code": "NoSuchKey",
    "message": "The object lake://lake/events/2026-10-18T12/part-0000.parquet was not found. Th…

    long string folded

Usage

When to use it
Use
A run's result, a job's config or a partition's stats that people search and drill into.
Use
Someone needs the path to a value for a query, a jq filter or a ticket.
Not for
A file or a snippet to read top to bottom. Use Code block.
Not for
Records that share the same fields. Use Table.

Rules

6 rules
Never
Show structured output as JSON.stringify in a CodeBlock when people will search or fold it. Because a flat dump of 400 lines has no folding, no search and no path, so finding partitions[2].rows means counting brackets.
Must
Name the tree with label: what the data is, such as "run_8f2a91 result". Because label names the tree, the search field and the scroll region, and "JSON" alone does not say which of three results it is.
Must
Pass the parsed value as data, not a JSON string. Because a string renders as one long string row, with nothing to fold or search inside it.
Never
Colour keys, strings or numbers with hues or yellow. Because colour in Sodium is status and yellow is the action, and JSON view shares Code block's ink steps.
Should
Open two levels by default, and set defaultExpandDepth={1} for payloads over a few hundred rows. Because the top keys tell what is inside, and a fully open large payload buries them.
Should
Keep maxRows near 16 beside other regions; the tree scrolls past it. Because an open payload can run to hundreds of rows and push the rest of the page away.

Accessibility

4 checks
The tree follows the WAI-ARIA tree pattern: role="tree", treeitems with aria-level and aria-expanded, one tab stop.
Search reports its "2/5" place in a polite live region.
When the tree overflows, its scroll box takes a tab stop so the keyboard can scroll it.
Copy and path copy say they copied once in a status region.

Keyboard

7 keys
Arrow Up and Down
Move between rows.
Arrow Right
Opens a branch, or moves into it.
Arrow Left
Closes a branch, or moves to its parent.
Home and End
Move to the first and last row.
Enter or Space
Toggles a branch, or unfolds a long string.
Enter in search
Steps to the next match; Shift+Enter steps back.
Escape in search
Clears the search.

Edge cases

6 edge cases
String over 120 characters
Folds to 80 with a "+n chars" cell.
Empty object or array
Shows {} or [] with nothing to open.
Key with spaces
The path writes it in brackets: $["row count"].
Search matches nothing
The tree says so in a sentence, with the query in mono.
Right to left page
The tree stays left to right.
Narrow at 390
Rows scroll sideways inside the frame.

API

7 props
data
unknown
label
string default 'JSON'
defaultExpandDepth
number default 2
toolbar
boolean default true
copy
boolean default true
path
boolean default toolbar
maxRows
number default 16

Tokens

15 tokens
--code-surface
var(--well)
--panel
#fafaf7
--line
#e2dfd5
--hover
rgb(22 21 18 / 0.04)
--selected
#fff4bf
--selected-strong
#ffec99
--accent-edge
#c9a700
--type-code
400 13px/20px var(--font-mono)
--type-code-sm
400 12px/16px var(--font-mono)
--type-micro
400 11px/14px var(--font-mono)
--text-1
#161512
--text-2
#55524a
--text-3
#6b675e
--row-sm
32px
--control-sm
26px

Install

For your coding agent

GitHub

Please star me pookie

198

A new design system every week

Leave your email before you copy the prompt.