gpui-kit GitHub

Components

Icon builder

A glyph from the bundled catalog.

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

use gpui_kit::display::Icon;

Construct

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

Options

Chain onto the value.

spinning(ident: impl Into<Ident>) -> Self
breathing(ident: impl Into<Ident>) -> Self
tone(tone: IconTone) -> Self
muted() -> Self
faint() -> Self
on_accent() -> Self
accent() -> Self
danger() -> Self
warning() -> Self
success() -> Self
info() -> Self
follow_direction(follow: bool) -> Self

Queries

Only answer; they change nothing.

resolved_size(theme: &Theme) -> f32
resolved_color(theme: &Theme) -> Hsla
flips_in(direction: LayoutDirection) -> bool

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/display/icon.rs