gpui-kit GitHub

Components

List builder

A list that renders only the rows its viewport holds.

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

use gpui_kit::data::List;

Construct

new(ident: impl Into<Ident>, count: usize, render_row: impl Fn(usize, &mut Window, &mut App) -> ListItem + 'static) -> Self

Options

Chain onto the value.

selected(id: impl Into<SharedString>) -> Self
row_height(height: f32) -> Self
visible_rows(rows: usize) -> 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_reorder(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/list.rs