Skip to content

Component Icon

MeowLynxSea edited this page Jun 18, 2026 · 6 revisions

Icon

A single SVG icon from the embedded asset source.

use yororen_ui::headless::icon::{icon, IconSource};

icon("check", IconSource::Builtin("check".into()), cx)
    .size(px(16.))
    .render(cx)

IconSource is either:

  • IconSource::Builtin(SharedString) — one of the 20+ bundled icons (check, x, chevron-down, info, search, …).
  • IconSource::Resource(SharedString) — a path into your app's AssetSource.

Props

Method Purpose
size(px) Render size.
color(hsla) Tint color. May be ignored for multi-color icons.

.render(cx) returns AnyElement.

Clone this wiki locally