Components / Layers
u:toasts
The toasts of the page, in a stack at the foot of the page's right edge, the newest below: items are { key, words, tone, at }.
The code
local ui = require("@pencere/ui")
local items = {}
ui.toast(items, "Saved notes.md", "ok", 0)
ui.toast(items, "3 files changed on disk", "info", 0)
root:child(u:toasts("toasts", { items = items }))
What it does
The toasts of the page, in a stack at the foot of the page's right edge, the newest below: items are { key, words, tone, at } (ui.toast). One that has run out by the time of the render is not drawn, and the page is drawn again when the next does. At most four are shown. Closed with its cross: { kind = "close", key }.