Skip to main content

Module button

Module button 

Source
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::new and chain builder methods.

Enums§

ButtonVariant
Closed enum naming the design-language variants of Button. See teksilo_core::styles::ButtonVariant for the canonical definition.
IconLocation
Where an optional icon is placed relative to the button label.
InteractionState
Internal interaction state.