pencere

Components / Controls

u:icon_button

A button that is an icon alone: its label says what it does, to a screen reader and in its tip.

A button that is an icon alone: its label says what it does, to a screen reader and in its tip. A button that is an icon alone: its label says what it does, to a screen reader and in its tip.

The code

return pencere.div():row():items_center():gap(6)
	:child(u:icon_button("add", { icon = "plus", label = "New file", keys = "cmd+n" }))
	:child(u:icon_button("close", { icon = "close", label = "Close" }))
	:child(u:icon_button("preview", { icon = "dot", label = "Preview", on = true }))
	:child(u:icon_button("info", { icon = "info", label = "About" }))

What it does

A button that is an icon alone: its label says what it does, to a screen reader and in its tip (with its keys). on (true or false) makes it one that stays down while what it stands for is on (a panel shown); size is its side (the theme's control). Pressed: { kind = "press" }.

kit/sandbox/library/ui/basic.luau, line 125

Its icon

An icon that a component or one of its items takes is an element the page made, a path of the page's own bundle ("icons/save.svg": an SVG or a PNG, tinted in the colour the component draws it in), or the name of one of the library's glyphs: check, chevron_down, chevron_left, chevron_right, chevron_up, close, dash, dot, info, plus, warning.