pencere

Components / Layers

u:modal

A modal: body in a card over a scrim.

A modal: body in a card over a scrim. A modal: body in a card over a scrim.

The code

root:child(u:modal("about", { label = "About" },
	pencere.div():p(20):gap(8):w(300)
		:child(pencere.text("pencere"):text_size(16):weight(700))
		:child(pencere.text("A real interface in a terminal's pane."):wrap():color("dim"))))

What it does

A modal: body in a card over a scrim. The page keeps whether it is open, by drawing it or not; escape and a click on the scrim say { kind = "dismiss" } (not with dismiss = false), and the page stops drawing it. The keyboard goes into it when it opens and back where it was when it closes.

The modal id with props (above) and body its content. With nothing given, the name of the modal that holds the keyboard now (the last drawn), or nil.

kit/sandbox/library/ui/layers.luau, line 96