Skip to content

zk-json-viewer ​

A JSON value as nested, expandable lists, with a copy button.

Props ​

PropTypeDefaultDescription
valuemixednullArray, object or scalar
expandedint1Number of levels open at first
labelstring'JSON'Accessible name
copyablebooltrueShows the copy button
copyLabelstring'Copy'Text of the button
idstring|nullnullIdentifier
classstring|nullnullCSS class(es) merged onto the root element

Undeclared attributes forward to the root element.

Branches are <details>, so they open with no script; each node has data-type. Needs the script copy of zk-scripts: the component asks for it by itself. The search of the Vue component is not ported.

Examples ​

Payload ​

blade
<x-zk-json-viewer :value="$payload" :expanded="2" />

Documentation of 3.2.0 , built from c93e21f on 3.2.0 by pipeline #2919741884 on 2026-10-06.