gpui-kit GitHub

Components

Pagination builder

First, previous, next, and last, plus a numbered range when there is one.

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

use gpui_kit::navigation::Pagination;

Construct

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

Options

Chain onto the value.

page(page: usize) -> Self
total_pages(total: usize) -> Self
unknown_total(has_next: bool) -> Self
total(total: PageTotal) -> Self
siblings(siblings: usize) -> Self
page_size(select: Entity<Select>) -> Self
on_select(handler: impl Fn(usize, &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/navigation/pagination.rs