Builtin Library
README.md
icon
Icon glyph rendered via a glyph font (default phosphor). Effectively
a label with the fontFamily fixed to the icon font, kept as its
own widget so callers don't have to remember which fontFamily the
icons live under.
Exports
icon(text: string, opts: IconOpts?) -> WidgetNode— module returns the builder function directly.
Options:
font: string?— override the font family. Default"phosphor".size: number?— setsstyle.fontSize.color: string?— setsstyle.color.padding: any?— setsstyle.padding.id: string?,style: table?— standard widget plumbing.
Usage
local Z = require("@builtin::modules.zui")
Z.icon("", { size = 16, color = "#dcdcdc" })
Z.icon("", { font = "fontawesome" })
Notes
- Stateless — returns a fresh widget table each call.
textis whatever the icon font renders for the codepoint you pass.- Top-level shortcuts (
size,color,padding,font) overwrite any conflicting field onstyle.