Modal

Feedback

Takes a block

Modal <dialog>, opened by a state flag; the browser supplies focus trapping and Escape.

Modal(visible: …, title: …) { … }

Example

state open = false Button("Delete") { on click { open = true } } Modal(visible: open, title: "Delete this?") { Text("This cannot be undone.") Modal.Footer { Button("Cancel") { on click { open = false } } } }

Renders with the class wf-modal, stable across releases, so a stylesheet may target it.

Props of Modal
Prop Type Meaning
visible: State

State flag that opens and closes it

title: String

Heading shown at the top

Attribute families: global, aria, data. Plus the universal props on every element: animate:, exit:, speed:, class:, ref:.