Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

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? — sets style.fontSize.
  • color: string? — sets style.color.
  • padding: any? — sets style.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.
  • text is whatever the icon font renders for the codepoint you pass.
  • Top-level shortcuts (size, color, padding, font) overwrite any conflicting field on style.