AI Components / JSON Viewer
JSON Viewer
Collapsible JSON tree with syntax coloring, expand/collapse, and circular ref detection.
ai-essentials v0.5.0
Playground
Examples
JSON tree
<ai-json-viewer style="max-width:400px;"></ai-json-viewer> Import
import { AiJsonViewer } from '@cognivo/components'; // Or tree-shake: import '@cognivo/components/ai-json-viewer'; Per-component imports ship only that component (~8 kB gzip).
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
data | unknown | — | JSON data |
expanded | boolean | true | Start expanded |
maxDepth | number | 5 | Max nesting depth |
Events
| Event | Detail | Description |
|---|---|---|
ai-json-path-click | {path} | Key path clicked |