Quaff

QDialog

Dialogs focus attention on a task, decision, or message above the page. Choose a modal or non-modal presentation, including fullscreen.

Open a dialog

Display content above the page, then dismiss it to continue.

info QDialog API Source

interface QDialogProps extends HTMLAttributes<HTMLDialogElement>

fullscreen
?: boolean = false
Determines whether the dialog is displayed in fullscreen mode.

modal
?: boolean = false
Determines whether the dialog is displayed as a modal or not.

persistent
?: boolean = false
Determines whether the dialog remains persistent, not closing on click outside.

position
?: QDialogPositionOptions = "default"
The position of the dialog relative to the viewport.

value
?: boolean = $bindable(false)
The bound value of the component.

Usage

Basic Dialog
Use bind:value with a boolean $state variable to open and close a dialog. By default the rest of the page stays interactive. Click outside or press Escape to dismiss it. The collection details in these examples are fictional.
COLLECTION RECORD · 014

The River Keeps Going

Mara Wells · Screenprint · 1987

Persistent Dialog
persistent prevents dismissal through Escape or outside clicks. Provide explicit actions to close it. Persistence and modality are independent; this example combines both.

Courier collection

Record the handoff with a deliberate choice.

Ready for collection

Dialog Positioning
Choose default, top, right, bottom, or left. Set the position before opening so the entrance animation starts from the selected edge. This example keeps the background interactive.
Fullscreen Dialog
fullscreen fills the viewport; add modal to block the background. This form edits a draft. Save applies it, while Cancel or Escape leaves the saved details unchanged.

Loan details

Eastbank Library · One month

Programmatic Control
Capture the component with bind:this to call show(), hide(), or toggle(). The bound value stays in sync, and onclose runs after each close. Stop propagation on external Show and Toggle buttons so they do not also count as outside clicks.

Dialog closed · Closes: 0

Accessible Dialog Content

Give every dialog an accessible name with aria-labelledby or aria-label. These examples focus the heading once the opening animation begins, so keyboard navigation starts at the title. Keep a visible close or cancel action, and let long content scroll so actions remain reachable on small screens or with larger text.