AI agent JS behaviour

JSON viewer

A collapsible JSON tree with type colours, child counts, copy path/value, expand-all, and a search that opens the way to each hit and marks it.

Real scenarios

The component as it is used in a product — not a specimen grid.

Important props

Important props
Prop Type Default What it does
data mixed null A PHP array/object or a JSON string.
depth int 1 Levels open on first paint.
searchable / max-height bool · string true · 26rem The search box and the tree’s maximum height.

Snippet

<x-nx::json-viewer :data="$response" :depth="2" max-height="24rem" />