gpui-kit GitHub

Components

Button builder

A labeled action.

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

use gpui_kit::controls::Button;

Construct

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

Options

Chain onto the value.

label(label: impl Into<SharedString>) -> Self
accessible_name(name: impl Into<SharedString>) -> Self
icon_only(glyph: Icon, name: impl Into<SharedString>) -> Self
join(join: ButtonJoin) -> Self
semantic_parent(parent: impl Into<SharedString>) -> Self
icon(glyph: Icon) -> Self
icon_position(position: IconPosition) -> Self
variant(variant: ButtonVariant) -> Self
primary() -> Self
secondary() -> Self
ghost() -> Self
danger() -> Self
link() -> Self
loading(loading: bool) -> Self
full_width(full_width: bool) -> Self
track_focus(handle: &FocusHandle) -> Self
on_click(handler: impl Fn(&mut Window, &mut App) + 'static) -> Self
checked_state(checked: bool) -> 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