gpui-kit GitHub

Components

Tree builder

A disclosure hierarchy.

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

use gpui_kit::data::Tree;

Construct

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

Options

Chain onto the value.

node(node: TreeNode) -> Self
nodes(nodes: impl IntoIterator<Item = TreeNode>) -> Self
expanded(ids: impl IntoIterator<Item = SharedString>) -> Self
expanded_ids<S: AsRef<str>>(ids: &[S]) -> Self
selected(id: impl Into<SharedString>) -> Self
visible_rows(rows: usize) -> 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
reorderable(reorderable: bool) -> Self
accepts(predicate: impl Fn(&DragItem, &DropPosition) -> bool + 'static) -> Self
on_move(handler: impl Fn(&DropIntent, &mut Window, &mut App) + 'static) -> Self

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/data/tree.rs