Json viewer

Inspects structured data with bounded nested disclosures and path search.

$: Object

name: "Untitled"

version: 1

$: Object
vehicle: Object

range: 386

battery: 84

connected: true

Use it for

  • Inspecting API responses, configuration, and nested records.

Not for

  • Editing structured data; use a form or editor.

Three ways in. They share one source, so the pixels match whichever you pick.

1. Import the package

npm install @noorddev/vlak-react

// once, next to your app's root
import "@noorddev/vlak-react/css";

import { JSONViewer } from "@noorddev/vlak-react";

Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/json-viewer.

2. Vendor the source

npx @noorddev/vlak-cli add json-viewer

The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.

3. Through shadcn

npx shadcn add https://vlak.dev/r/json-viewer.json

The same registry item, installed by shadcn's CLI.

CSS only

<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />

No React. Link vlak.css and use the markup and classes below.

import { JSONViewer } from "@noorddev/vlak-react";

<JSONViewer label="Vehicle data" data={{ vehicle: { range: 386, battery: 84 }, connected: true }} />

JSONViewer

Bounded JSON inspection using native disclosures and path/value search.

PropTypeDefaultDescription
datarequiredunknown
labelstring"Structured data"
searchablebooleantrue
maxDepthnumber8Bounds rendering of unusually deep data.
maxEntriesnumber100Maximum children shown per object or array.
maxNodesnumber1000Total node budget across the inspected document.
maxStringLengthnumber2000Maximum string characters displayed per value, before escaping.

Also accepts HTMLAttributes<HTMLDivElement>.

KeysDoes
Tab, Enter, SpaceTab reaches search, expand/collapse controls, and summaries; Enter or Space toggles a disclosure.
<div class="rs-json-viewer" role="region" aria-label="Vehicle data"><div class="rs-json-viewer-body"><details open><summary class="rs-json-viewer-summary">vehicle: Object</summary><div class="rs-json-viewer-children"><p class="rs-json-viewer-value">range: 386</p></div></details></div></div>
.rs-json-viewer.rs-json-viewer-tools.rs-json-viewer-body.rs-json-viewer-summary.rs-json-viewer-children.rs-json-viewer-value.rs-json-viewer-note