| title | JSON Tree Viewer |
|---|---|
| description | The collapsible tree that renders Playground output |
| audience | developer |
JsonTree renders any JSON-safe value from the Playground sandbox as a collapsible tree, DevTools-style, instead of a wall of stringified JSON.
- Recursive — each object/array node is another
JsonTreewithdepth + 1 - Auto-open depth 1 — the root level starts expanded, everything deeper starts collapsed
- Primitive styling — strings (quoted), numbers, booleans, and
nulleach get a CSS modifier class for syntax-color output - Primitives at the console line level are printed as plain text; only containers get the tree
The values it receives were already sanitized inside the sandbox (functions become ƒ name(), circular references become [Circular], errors become Name: message), so the component can assume plain JSON.