Component libraryJSON viewer

JSON viewer

Pro

Inspect valid JSON as a searchable keyboard tree or exact read-only source with paths and consumer-owned copy actions.

npx shadcn@latest add @tidal-pro/json-viewer
Desktop viewport

Installation

Pro source is gated. Configure the @tidal-pro registry using the agent guide. Create an access key from your account after purchasing.

Terminal
npx shadcn@latest add @tidal-pro/json-viewer

Import components/ui/tidal.css, components/ui/json-viewer.css, components/ui/tree-view.css, components/ui/code-block.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.

Usage

Complete example source · Dependency and asset manifest

Loading the complete example…

API & behavior

label and optional description/headingLevel name the viewer. value accepts JSON primitives, arrays, or plain JSON objects; circular references, sparse arrays, accessors, symbols, nonfinite numbers, class instances, and nesting beyond the documented safety boundary render a localized configuration alert rather than being evaluated. view/onViewChange controls Tree or Source. expandedPaths/onExpandedPathsChange and selectedPath/onSelectedPathChange use RFC 6901 JSON Pointer strings, including the empty root path; display paths remain readable $.property/[index] labels. Optional controlled query/onQueryChange searches full keys, primitive values, and display paths, highlights visible matches, and temporarily reveals matching ancestors. maxStringLength bounds visible tree strings while exact values remain available to the copy adapter and source view. onCopyRequest receives the exact path, display path, JSON value, and serialized text; the component never touches the clipboard. disabled, dir, localized labels, native section/search/view/copy attrs and refs, tree ref, sourceMaxHeight, className and remaining safe section attributes are supported. Native handlers run before view/search/copy callbacks and may prevent proposals. The component performs no parsing, evaluation, logging, request, storage, clipboard write, or persistence.

Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.

Building with an agent?Give it the installation guide and component catalog.