egui_json_tree
An interactive JSON tree visualiser for egui
, with search and highlight functionality.
Usage
let value = json!;
// Simple:
new.show;
// Customised:
let response = new
.style
.default_expand
.abbreviate_root // Show {...} when the root object is collapsed.
.toggle_buttons_state
.on_render
.show;
// Reset the expanded state of all arrays/objects to respect the `default_expand` setting.
response.reset_expanded;
See demo.rs and run the examples for more 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.
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 Examples