class

Egui::Button

Inherits Egui::Widget < Reference < Object

Constructors

new(text : String, id : String | Nil = nil)
Source

Instance methods

cursor(icon : CursorIcon) : self

CSS cursor style for this button — the icon the mouse shows while hovering it (default: style.visuals.interact_cursor).

Source
gradient(c1 : Color32, c2 : Color32) : self

Vertical gradient fill (top c1 → bottom c2); overrides the plain state fill.

Source
icon(name : Symbol) : self

A vector icon from Icons::NAMES, drawn left of the text.

Source
icon(svg : Svg) : self

An SVG icon (e.g. Icon.from_file(:lucide, :save, tint: fg)), drawn left of the text; takes precedence over the Symbol vector icon, below a raster texture.

Source
image_texture(texture_id : UInt64) : self

A raster icon: texture drawn left of the text (phase 6; takes precedence over the vector icon).

Source
inspector_label

Short human label for the inspector (the button's text, a label's text…); nil = no meaningful label.

Source
min_size(size : Vec2) : self

egui Button::min_size — the button never shrinks below this (text stays centered inside); the hook behind Ui#big_button.

Source
style_class

CSS-like class this widget styles under in the global StyleSheet (nil = not registered yet). Widgets adopt the class system gradually; see Button and containers/sidebar.cr for the reference wiring (base + state overlays).

Source
style_properties

Every key #ui reads: the common button set plus the box-model and 3D-bevel/shadow extras (see default_theme.cr for the defaults). Declared here — the inspector renders what it's told.

Source
text
Source
ui(ui : Ui) : Response
Source