1. Reference
  2. Overlays

<dialog>

A dialog with a title, a message, and confirm and cancel buttons that run statements.

Overlays
dialog.ham
<dialog title="Cancel this trip?"
        confirm-label="Cancel trip"
        cancel-label="Keep it">
    <text>Your booking in Lisbon will be released. This can't be undone.</text>
</dialog>
The snippet drawn by Hype Apps on a phone, in light mode The snippet drawn by Hype Apps on a phone, in dark mode
This snippet as Hype Apps draws it on a phone. It follows this page's light or dark theme.

Attributes

NameWhat it doesDefault
cancel-label Show a cancel button with this label.
string
confirm-label
also action-label
The confirm button's label.
string
OK
icon An icon above the title (icon name).
string
title Dialog title
string
Dialog

Commands

NameWhat it does
dismiss Close it.
show Open it.

Events

NameWhat it does
action-cancel Statements to run when the cancel button is pressed.
action-confirm Statements to run when the confirm button is pressed (the dialog closes first), e.g. "#db.trip.delete:$id". @on.confirm is the same.

Readings

NameWhat it does
open Whether it is showing.

Any tag also takes gestures: @on.tap, @on.longpress, @on.doubletap and @on.swipeleft (and right, up and down). @click runs on a tap too.

This page is also Markdown, and all of HAM is in llms.txt.