gpui-kit GitHub

Components

IconButton builder

An action carried by a glyph alone.

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

use gpui_kit::controls::IconButton;

Construct

new(ident: impl Into<Ident>, glyph: Icon, name: impl Into<SharedString>) -> Self

Options

Chain onto the value.

variant(variant: ButtonVariant) -> Self
primary() -> Self
secondary() -> Self
ghost() -> Self
danger() -> Self
loading(loading: bool) -> Self
semantic_parent(parent: impl Into<SharedString>) -> Self
track_focus(handle: &FocusHandle) -> Self
join(join: ButtonJoin) -> Self
on_click(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/button.rs