Opus Motion ★ Star on GitHub

Data · json-tree-expand

JSON tree expand

A JSON viewer built from a data prop: objects and arrays expand node by node with a rotating caret and child-count badge, indent guides, syntax-coloured keys and values, a highlighted newest row, auto-scroll, and a path breadcrumb along the bottom.

A free, MIT-licensed animated chart from the Opus Motion Library — 616 motions for Remotion, React and plain HTML.

JSON tree expand: three frames of the animated chart, start, middle and end
JSON tree expand — start, middle and end of the 8.0-second motion.

What JSON tree expand is for

API-response explainers, "what the data looks like" beats, structured-output / schema stories for AI, developer docs and tutorials, config-file walkthroughs.

  • json
  • tree
  • data
  • api
  • response
  • schema
  • structured output
  • viewer
  • developer
  • config
  • syntax
  • expand
  • code
  • software
  • ui

Details

Category
Animated charts & data visualisation
Length
8.0 s (240 frames at 30 fps)
Formats
16:9, 1:1, 9:16
Weight
light
Transparent overlay
yes
Seamless loop
no
Text props
title
Colour props
background panel ink accent
Mood
hud, playful, ui
Roles
subject

Use JSON tree expand in Remotion, React or HTML

Remotion project

terminal
# copy this motion into your Remotion project
node cli/mgl.mjs add json-tree-expand --to ../my-app/src

# render an mp4 (run in the library folder)
node cli/mgl.mjs render json-tree-expand --props '{"title":"response.json","background":"#0B0E14","panel":"#12161F","ink":"#E6EAF2","accent":"#79B8FF"}'

# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export json-tree-expand --as webm-alpha --props '{"title":"response.json","background":"#0B0E14","panel":"#12161F","ink":"#E6EAF2","accent":"#79B8FF"}'

React / Next.js

tsx
import {MotionPlayer} from 'opus-motion-library/web';

<MotionPlayer
  motion="json-tree-expand"
  props={{
    title: 'response.json',
    background: '#0B0E14',
    panel: '#12161F',
    ink: '#E6EAF2',
    accent: '#79B8FF',
  }}
  playOnView
  loop="auto"
/>

Plain HTML / WordPress

html
<script src="opus-motion.element.js" defer></script>

<opus-motion motion="json-tree-expand"
  props='{"title":"response.json","background":"#0B0E14","panel":"#12161F","ink":"#E6EAF2","accent":"#79B8FF"}'>
</opus-motion>

Compose spec (multi-scene video)

json
{
  "width": 1920,
  "height": 1080,
  "fps": 30,
  "scenes": [
    {
      "motion": "json-tree-expand",
      "props": {
        "title": "response.json",
        "background": "#0B0E14",
        "panel": "#12161F",
        "ink": "#E6EAF2",
        "accent": "#79B8FF"
      }
    }
  ]
}

JSON tree expand props

13 parameters — change any of them to make the motion yours.

PropDefaultWhat it does
data{"id":1042,"name":"Ada Example","active":true,"roles":["admin","editor"],"profile":{"em…any JSON value (object / array) to expand
title"response.json"file name in the window header
collapseDepth3nesting depth from which objects stay collapsed as {…} (3 = three levels expand)
showBreadcrumbtrueshow the $.path breadcrumb of the newest row
showLineNumberstrueshow line numbers
every7frames between rows
speed1timing multiplier
startAt0frame the viewer starts
background"#0B0E14"page colour or 'transparent'
panel"#12161F"window colour (dark or light — syntax colours adapt)
ink"#E6EAF2"text colour
accent"#79B8FF"highlight / breadcrumb colour
fontFamily""monospace font override (empty = JetBrains Mono)

Notes & credits

Technique sources:

  • original (generic developer explainer)