gpui-kit GitHub

Components

JsonView builder

A collapsible view of a structured value.

A builder is RenderOnce. Construct and mount it in one expression.

use gpui_kit::structured::JsonView;

Construct

new(ident: impl Into<Ident>, value: JsonValue) -> Self

Options

Chain onto the value.

root_label(label: impl Into<SharedString>) -> Self
expanded(paths: impl IntoIterator<Item = SharedString>) -> Self
expanded_paths<S: AsRef<str>>(paths: &[S]) -> Self
selected(path: impl Into<SharedString>) -> Self
visible_rows(rows: usize) -> Self
row_height(height: f32) -> Self
on_toggle(handler: impl Fn(SharedString, bool, &mut Window, &mut App) + 'static) -> Self
on_select(handler: impl Fn(SharedString, &mut Window, &mut App) + 'static) -> Self

Queries

Only answer; they change nothing.

disclosed_paths(cx: &App) -> Vec<SharedString>

Rendered by

Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.

Source: crates/gpui-kit/src/structured/json_view.rs