gpui-kit GitHub

Components

FilterBar builder

A row of active conditions, a way to add one, a clear-all, and the count.

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

use gpui_kit::controls::FilterBar;

Construct

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

Options

Chain onto the value.

condition(condition: FilterCondition) -> Self
conditions(conditions: impl IntoIterator<Item = FilterCondition>) -> Self
count(count: ResultCount) -> Self
noun(noun: impl Into<SharedString>) -> Self
add_control(control: impl IntoElement) -> Self
add_label(label: impl Into<SharedString>) -> Self
clear_label(label: impl Into<SharedString>) -> Self
on_add(handler: impl Fn(&mut Window, &mut App) + 'static) -> Self
on_remove(handler: impl Fn(SharedString, &mut Window, &mut App) + 'static) -> Self
on_clear(handler: impl Fn(&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/controls/filter_bar.rs