Reference

Popconfirm

A question beside the button in its block before what it does: the button opens it, on confirm hears yes, on cancel no or Escape; the focus starts on the answer that loses nothing.

Popconfirm(title: String, yes: String, no: String, …) { … }

Since 6.2.0

yes

no

notes.md

draft.md

todo.md

Example

wf

state files = ["notes.md", "draft.md", "todo.md"] Stack(gap: .sm) { for f in files by f { Row(gap: .sm, align: .center, justify: .between) { Text(f) Popconfirm(title: "Delete {f}?", yes: "Delete", no: "Keep").danger { on confirm { files = files.filter(x => x != f) } Button("Delete").sm.outlined } } } }

Hearing no

wf

state said = "Draft" Popconfirm(title: "Publish to everyone?", yes: "Publish") { on confirm { said = "Published" } on cancel { said = "Not yet" } Button("Publish").primary } Text(said)

Props

Props of Popconfirm
PropTypeUnsetMeaning

title:

String (required)

—

The question, in a layer above the first button of its block when that button is pressed

yes:

String

Yes

The yes button's words; pressing it fires on confirm

no:

String

Cancel

The no button's words, which has the focus when it opens; pressing it or Escape fires on cancel

danger:

Bool

false

What yes does cannot be taken back: the yes button is drawn in the danger colour, not the primary, and the question in bold. Written as a flag, .danger, or danger: true.

Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.

Flags and cases

A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.

.danger

Events

Events of Popconfirm
EventSendsMeaning
on confirm—
on cancel—

Every element also takes the props, the events and the attribute families listed on every element.

Slots

children

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