Download this notebook from GitHub (right-click to download).

import json
import panel as pn


The JSON pane allows rendering arbitrary JSON strings, dicts and other json serializable objects in a panel.


For layout and styling related parameters see the customization user guide.

  • depth (int): Depth to which the JSON structure is expanded on initialization (depth=-1 indicates full expansion)

  • hover_preview (bool): Whether to enable hover preview for collapsed nodes

  • object (str or object): JSON string or JSON serializable object

  • theme (string): The color scheme, one of ‘light’ or ‘dark’

The JSON pane can be used to render a tree view of arbitrary JSON objects which may be defined as a string or a JSON-serializable Python object.

json_obj = {
    'boolean': False,
    'dict': {'a': 1, 'b': 2, 'c': 3},
    'int': 1,
    'float': 3.1,
    'list': [1, 2, 3],
    'null': None,
    'string': 'A string',

json = pn.pane.JSON(json_obj, name='JSON', height=300, width=500)



The JSON pane exposes a number of options which can be changed from both Python and Javascript. Try out the effect of these parameters interactively:

pn.Row(json.controls(jslink=True), json)
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.

Download this notebook from GitHub (right-click to download).