iconset / icon_def / icon

block

Bundled Lucide and Bootstrap icon packs: use inline, as a placeable block, or as a badge on a shape.

Full Lucide and Bootstrap Icons packs ship compiled into the binary — no runtime disk read, and only used icons land in the output sprite (_wdoc/icons.svg). Icons paint with currentColor, so colour follows the surrounding text or class.

Three ways to use an icon

Inline as a :lucide.check: pattern in a p or span; as a placeable icon block (a legal diagram / container child, positioned by x / y like a rect); or as a badge on a box-like shape (rect / circle / container / process / decision / terminator) via icon / icon_size / icon_pos / icon_class.

// 1. Inline pattern in a p (or span):
p "Status: :lucide.check: ready"

// 2. Placeable icon block (a legal diagram child):
diagram { width = 80  height = 80
  icon { name = "lucide.compass"  x = 10.0  y = 10.0  width = 60.0  height = 60.0 }
}

// 3. Badge on a shape:
process "Validate" {
  id = v  width = 120.0  height = 50.0
  icon = "lucide.shield-check"
  icon_pos = :top_right
}

Iconsets

Declare an iconset to rename a pack or set default styling; per-icon icon_def children override individual icons within the set. A bare :name: then reads from that set.

iconset ui {
  pack  = "lucide"
  size  = "1.15em"
  color = "var(--wdoc-accent)"
  icon_def "heart" { color = "#bf616a" }
}

p "We :heart: WCL."

As a shape badge, icon_pos accepts :center, :top_left (default), :top_right, :bottom_left, :bottom_right, :left, :right.

Related

- diagram

- tree