-
Notifications
You must be signed in to change notification settings - Fork 9
Component IconButton
MeowLynxSea edited this page Jan 24, 2026
·
5 revisions
A button that displays only an icon.
This is the preferred primitive for “close”, “more”, “settings” style actions where the icon is the only content.
use gpui::px;
use yororen_ui::component::{icon, icon_button, IconName};
let close = icon_button(icon(IconName::Close).size(px(14.)))
.on_click(|_ev, _window, _cx| {
// ...
});- Small icon-only actions in toolbars and input affordances
- Close buttons inside overlays
-
icon_button(icon): constructor -
id(...): stable identity clickable(bool)disabled(bool)variant(ActionVariantKind)-
on_click(...)/on_hover(...) -
bg(Hsla)/hover_bg(Hsla) -
icon_size(px(...)): size override for the provided icon
- Size:
36x36 - Corner radius:
rounded_md - Default icon size:
14px(unless overridden)
- The button is focusable by default and uses a focus-visible border.
use gpui::px;
use yororen_ui::component::{icon, icon_button, IconName};
let view = icon_button(icon(IconName::Close)).icon_size(px(12.));use yororen_ui::component::{icon, icon_button, IconName};
use yororen_ui::theme::ActionVariantKind;
let danger_close = icon_button(icon(IconName::Close)).variant(ActionVariantKind::Danger);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.