-
Notifications
You must be signed in to change notification settings - Fork 9
Component Button
MeowLynxSea edited this page Jun 18, 2026
·
5 revisions
A clickable button with a caption and optional icon.
use yororen_ui::headless::button::button;
button("save", cx)
.caption("Save")
.on_click(|_, _, _| { /* handle click */ })
.render(cx)| Method | Purpose |
|---|---|
caption(text) |
Button label. |
icon(source) |
Optional leading IconSource. |
icon_size(px) |
Size of the leading icon (default 16). |
caption_icon(text, source) |
Convenience: set both caption and icon. |
variant(v) |
ActionVariantKind::Neutral (default) / Primary / Danger. |
disabled(v) |
Disable interaction and dim visuals. |
on_click(closure) |
Fn(&ClickEvent, &mut Window, &mut App) + 'static + Send + Sync. |
Factory takes (id, cx). .render(cx) returns Stateful<Div>. No state entity. Add body content via .child(...) on the returned div if you didn't pass a caption.
See also: IconButton, ToggleButton, SplitButton.
Yororen UI v0.3.0 · repository · Apache-2.0 · This wiki documents Yororen UI v0.3.0.
This wiki documents Yororen UI v0.3.0 — the headless-core, swappable-renderer build.