Skip to main content

Module json_view

Module json_view 

Source
Expand description

JSON view widget for pretty-printing JSON text.

Renders formatted JSON with indentation and optional syntax highlighting. Does not depend on serde; operates on raw JSON strings with a minimal tokenizer.

§Example

use ftui_widgets::json_view::JsonView;

let json = r#"{"name": "Alice", "age": 30}"#;
let view = JsonView::new(json);
let lines = view.formatted_lines();
assert!(lines.len() > 1); // Pretty-printed across multiple lines

Structs§

JsonView
Widget that renders pretty-printed JSON with syntax coloring.

Enums§

JsonToken
A classified JSON token for rendering.