-
Notifications
You must be signed in to change notification settings - Fork 9
Component Icon
MeowLynxSea edited this page Jun 13, 2026
·
6 revisions
A headless icon. The renderer decides how to draw IconSource (an inline SVG, a font glyph, or a remote asset).
use yororen_ui::headless::icon::icon;use yororen_ui::headless::icon::icon;
use yororen_ui::renderer::IconSource;
icon("save-icon", IconSource::Named("check".into()), cx)
.size(px(16.0))
.render(cx)| Method | Purpose |
|---|---|
size(px) |
Render size (the renderer decides intrinsic vs container scaling). |
color(hsla) |
Tint color (the renderer may ignore this for multi-color icons). |
The factory's second argument is the IconSource (e.g. IconSource::Named("check".into())).
- Factory takes
(id, source, _cx). -
IconSourcelives inyororen_ui::renderer(re-exported from headless). The exact variants depend on the renderer in use. -
.render(cx)returnsAnyElement. Useicon(...).into_any_element()-style composition if you need to embed it inside aDivchild slot.
Avatar, Badge, IconButton
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.