egui_json_tree
An interactive JSON tree visualiser for egui, with search and highlight functionality.
See the demo source code and webpage for detailed use cases, including:
- Automatic expansion of arrays/objects and highlighting, based on search term matches.
- Copying JSON paths and values to the clipboard.
- A JSON editor UI.
Usage
let value = json!;
// Simple:
new.show;
// Customised:
let response = new
.style
.default_expand // Expand all arrays/object by default.
.on_render
.show;
// By default, the tree will expand/collapse all arrays/objects
// to respect the `default_expand` setting when it changes.
// If required, you can manually trigger this reset, e.g. after a button press:
if ui.button.clicked
Supported JSON Types
JsonTree can visualise any type that implements value::ToJsonTreeValue.
See the table of crate features below for provided implementations.
| Feature/Dependency | JSON Type | Default |
|---|---|---|
serde_json |
serde_json::Value |
Yes |
simd_json |
simd_json::owned::Value |
No |
If you wish to use a different JSON type, see the value module, and disable default features in your Cargo.toml if you do not need the serde_json dependency.
Run Demo App