gpui-kit GitHub

Components

Table builder

A table with a header that stays put while the body scrolls.

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

use gpui_kit::data::Table;

Construct

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

Options

Chain onto the value.

column(column: Column) -> Self
columns(columns: impl IntoIterator<Item = Column>) -> Self
rows(rows: impl IntoIterator<Item = Row>) -> Self
rows_from(count: usize, render_row: impl Fn(usize, &mut Window, &mut App) -> Row + 'static) -> Self
sort(sort: Option<(SharedString, SortDirection)>) -> Self
sorted_by(key: impl Into<SharedString>, direction: SortDirection) -> Self
selected(id: impl Into<SharedString>) -> Self
row_height(height: f32) -> Self
visible_rows(rows: usize) -> Self
on_sort(handler: impl Fn(SharedString, SortDirection, &mut Window, &mut App) + 'static) -> Self
on_select(handler: impl Fn(SharedString, &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/table.rs