Button

A clickable control that triggers an action. Supports Primary, Secondary, Ghost, Outline, Destructive, and Link variants.

Figma Mockup

Button primary Button primary hover Button secondary Button secondary hover

Preview

Rendered in WASM — scroll may behave differently from the rest of the page

Usage

rust
use ui_theme::components::button;
use ui_theme::{ControlVariant, ControlSize};

button(ui, &theme, "Click me", ControlVariant::Primary, ControlSize::Md);

Props

Prop Type Default Description
ui &mut Ui required The egui UI context
theme &Theme required Theme instance
label impl Into<WidgetText> required Button text
variant ControlVariant Primary Visual variant
size ControlSize Md Button size

Variants

VariantDescription
PrimaryFilled blue — primary actions
SecondarySubtle fill — secondary actions
GhostTransparent — tertiary actions
OutlineBorder only — alternative secondary
DestructiveRed — dangerous actions
LinkText only — navigation actions