Expand description
Button — a labelled, activatable action trigger.
Button is the primary action surface in Teksilo. It renders a text
label (optionally with a leading, trailing, top, or bottom icon), fires
a closure on click / Space / Enter / AT click, and advertises seven
design-language variants via ButtonVariant. Chrome (fill, border,
focus ring, padding) is delegated to the active [ButtonStyle]; the
default RecipeButtonStyle implements the Int UI token ladder.
§When to use
- Primary action:
.variant(ButtonVariant::Filled)— one per context. - Secondary / cancel: default
ButtonVariant::Plain. - Danger:
ButtonVariant::Destructive(IntUI maps this to Filled). - Text-only link:
ButtonVariant::Link/ButtonVariant::Ghost.
§Accessibility
Announces as Role::Button with the resolved label as its AT name.
Keyboard: Space / Enter activate; the lone-KeyUp guard prevents spurious
re-activation when a shortcut consumes the KeyDown and returns focus here.
let _btn = Button::new(lit!("Save"))
.variant(ButtonVariant::Filled)
.on_activate_fn(|ctx| ctx.send_intent(Intent::new("app.save")));Structs§
- Button
- A labelled action trigger; use
Button::newand chain builder methods.
Enums§
- Button
Variant - Closed enum naming the design-language variants of
Button. Seeteksilo_core::styles::ButtonVariantfor the canonical definition. - Icon
Location - Where an optional icon is placed relative to the button label.
- Interaction
State - Internal interaction state.