Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

icons

Phosphor icon constants. The phosphor font is registered as a named family phosphor in the engine, so render icons by setting style.fontFamily = "phosphor" on the label that contains them.

The font is ALSO appended to the proportional family as a fallback, but the fallback path is unreliable for PUA codepoints in egui 0.34 (see issue #2191) — always pass fontFamily = "phosphor" for icons.

Curated set covering DAW transport, media controls, file management, desktop shell, editor chrome, and common state indicators. For icons not listed here, see https://phosphoricons.com — pass the codepoint as a UTF-8 string literal directly.

Exports

  • Icon.styled(extra: LabelOpts?) -> LabelOpts — build a UI.label opts table with style.fontFamily = "phosphor" applied. Merges with the supplied extra.
  • Icon.<Name>: string — UTF-8 codepoint constants. Categories:
    • Transport / media: Play, Pause, Stop, Record, FastForward, Rewind, SkipForward, SkipBack, Repeat, Shuffle.
    • Audio / DAW: Microphone, Headphones, Equalizer, Sliders, Metronome, MusicNote, Waveform, SpeakerHigh, SpeakerLow, SpeakerNone, SpeakerSimpleHigh, SpeakerMuted.
    • File / folder: Folder, FolderOpen, File, FileText, FileAudio, FileVideo, FileImage, FileCode, FloppyDisk, Trash, UploadSimple, DownloadSimple.
    • Desktop / shell: Desktop, DesktopTower, Monitor, Keyboard, Mouse, House, Sidebar, Cpu.
    • Editor: Pencil, Plus, Minus, Check, MagnifyingGlass(Plus|Minus)?, Gear, Power, Eye, EyeSlash, Lock, LockOpen, Bell, Palette, Funnel, Clipboard.
    • Code / dev: Code, Terminal, Bug, GitBranch, GitCommit, GitMerge, Database, Cloud.
    • Arrows / nav: ArrowUp/Down/Left/Right, ArrowsClockwise, ArrowsIn, ArrowsOut, CaretUp/Down/Left/Right.
    • Layout / list: List, GridFour, DotsThree, DotsThreeVertical.
    • State / status: Info, Warning, WarningCircle, CheckCircle, XCircle, Question, Heart, Star, Tag, Hash, At.
    • Shapes: Circle, Square, Triangle.
    • Productivity / shell apps: Calculator, Notepad, NotePencil, Note.
    • Games / cards: GameController, Bomb, Cards, Diamond, Spade, Club.

Types:

  • LabelStyle = { fontFamily?: string, fontSize?: number, color?: string, [string]: any }
  • LabelOpts = { style?: LabelStyle, [string]: any }

Usage

local Icon = require("@builtin::modules.icons")

UI.label(Icon.Play, { style = { fontFamily = "phosphor", fontSize = 24 } })
UI.label(Icon.Folder .. "  Documents", {
    style = { fontFamily = "phosphor", fontSize = 14 },
})

-- Or use the helper to enforce the phosphor family:
UI.label(Icon.Play, Icon.styled({ style = { fontSize = 24, color = "#fff" } }))

Notes

  • The constants are plain string values — each is a single UTF-8 Private Use Area codepoint. Concatenate freely with surrounding text.
  • Icon.styled mutates the supplied opts table (extra.style is forced). Pass a fresh table per call site if you need to reuse opts.
  • Curated subset only — for icons outside this set, paste the codepoint from https://phosphoricons.com directly.