Components / Controls
u:banner
A strip that says something of what is below it, in a tone, with buttons that answer it: a file changed on disk, a draft to restore.
The code
return u:banner("conflict", {
tone = "warn",
icon = "warning",
words = "notes.md changed on disk since it was opened.",
actions = { { key = "reload", title = "Reload", primary = true }, { key = "keep", title = "Keep mine" } },
dismiss = true,
})
What it does
A strip that says something of what is below it, in a tone, with buttons that answer it: a file changed on disk, a draft to restore. words is a string or an element (a pencere.rich); actions are { key, title, primary, keys }; dismiss (true, or the words of its label) adds a button that closes it. Its buttons: { kind = "press", key = <the action's key> } and { kind = "dismiss" }.
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.