Skip to content

Component IconButton

MeowLynxSea edited this page Jun 18, 2026 · 5 revisions

IconButton

A square button that holds an icon instead of a caption.

use yororen_ui::headless::icon::IconSource;
use yororen_ui::headless::icon_button::icon_button;

icon_button("close", cx)
    .icon(IconSource::Named(IconName::Close))
    .on_click(|_, _, _| { /* close */ })
    .render(cx)

Props

Method Purpose
icon(source) The IconSource to render.
icon_size(px) Size of the icon (the button pads around it).
variant(v) ActionVariantKind::Neutral (default) / Primary / Danger.
disabled(v) Disable interaction.
on_click(closure) Fn(&ClickEvent, &mut Window, &mut App) + 'static + Send + Sync.

.render(cx) returns Stateful<Div>. No state entity.

See also: Button, ToggleButton, Icon.

Clone this wiki locally