-
Notifications
You must be signed in to change notification settings - Fork 9
Component IconButton
MeowLynxSea edited this page Jun 13, 2026
·
5 revisions
A square button that holds an icon instead of a caption.
use yororen_ui::headless::icon_button::icon_button;use yororen_ui::headless::icon_button::icon_button;
use yororen_ui::renderer::IconSource;
icon_button("close-btn", cx)
.icon(IconSource::Named("x".into()))
.on_click(|_, _window, _cx| {
// close
})
.render(cx)| Method | Purpose |
|---|---|
icon(source) |
The IconSource to render. |
icon_size(px) |
Size of the icon (the button pads around it). |
variant(v) |
One of the ActionVariantKind values. |
disabled(v) |
Disable interaction. |
on_click(closure) |
Fn(&ClickEvent, &mut Window, &mut App) + 'static + Send + Sync. |
- Factory takes
(id, cx). Thecxis needed for the focus handle. - No state entity. Capture self with
cx.entity().clone(). -
.render(cx)returnsStateful<Div>.
Button, ToggleButton, Icon
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.