Widgets
Icon
Renders a single glyph from the icon registry.
Renders a single glyph from the icon registry.
Usage
import { ui, rgb } from "@rezi-ui/core";
ui.icon("status.check");
ui.icon("arrow.right", { style: { fg: rgb(0, 255, 0) } });
ui.icon("ui.search", { fallback: true });Props
| Prop | Type | Default | Description |
|---|---|---|---|
icon | string | required | Icon path (e.g. "status.check") |
style | TextStyle | - | Optional style override |
fallback | boolean | false | Use ASCII fallback glyph |
key | string | - | Reconciliation key |
Examples
1) Inline status
import { ui } from "@rezi-ui/core";
ui.row({ gap: 1 }, [ui.icon("status.warning", { fallback: true }), ui.text("Needs attention")]);2) File icon
import { ui } from "@rezi-ui/core";
ui.row({ gap: 1 }, [ui.icon("file.folder", { fallback: true }), ui.text("src/")]);Notes
- Icons render as text. Use
fallback: truefor portable rendering. - See Icons for the full registry.