Skip to content

React package · v0.1.0

react-json-glimpse

A small, virtualized JSON viewer for React apps that need readable payload previews without bringing along an old dependency tree.

Why it exists

Sometimes you just need to show a large JSON payload in a React UI. This focuses on that read-only path: visible rows are virtualized, collapsed branches stay cheap, and styling is handled with CSS variables instead of another theme dependency.

Install

pnpm add react-json-glimpse

Use

import { JsonGlimpse } from "react-json-glimpse";

export function PayloadPreview({ payload }: { payload: unknown }) {
  return (
    <JsonGlimpse
      value={payload}
      height={520}
      initialExpandedDepth={2}
      onSelect={({ path, value }) => console.log(path, value)}
    />
  );
}

What it is good at

  • · TypeScript-first API
  • · Virtualized rows for large payloads
  • · Lazy expand and collapse behavior
  • · SSR-safe rendering
  • · React 18 and React 19 peer support