Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

chip

Compact tag/badge. Variants ("info", "success", "warning", "error") pick a foreground/background colour pair from the active theme. Built as a panel + label composition so the engine has no dedicated arm for what is fundamentally a coloured rounded text-box.

Exports

  • chip(text: string?, opts: ChipOpts?) -> WidgetNode — build a chip widget node.

Types:

  • ChipVariant = "info" | "success" | "warning" | "warn" | "error" | "danger"
  • ChipOpts = { id?, variant?, bg?, color?, fontSize?, padding?, borderRadius? }

Usage

local chip = require("@builtin::modules.zui.widget.chip")

chip("New", { variant = "success" })
chip("Beta", { bg = "#222", color = "#fff" })

Notes

  • bg and color per-call override the variant-selected colours.
  • Defaults: fontSize = 11, padding = { 1, 6, 1, 6 }, borderRadius = 4.
  • Colours pull from Theme.default (success, warn, danger, info, bg_deep).