Dialog
Modal overlay with title/description, X-close, click-outside dismiss.
ui overlay
Preview
Installation
npx slintcn@latest add dialogUsage
import { Dialog } from "slintcn/components/dialog.slint";
// Mount as the LAST child of Window:
dlg := Dialog {
width: parent.width;
height: parent.height;
open <=> dialog-open;
title: "Confirm your action";
description: "This cannot be undone.";
}
Properties
open
in-out
bool
Two-way; consumer sets true to show, slintcn sets false on close.
title
in
string
Heading at the top of the modal.
description
in
string
Body text under the title.
dismiss-on-backdrop
in
bool
When true, clicking outside the panel closes the modal.
close-label
in
string
Tooltip / accessible label for the X-close button.
dismissed
callback
()
Fired when the modal closes for any reason.
API
Accessibility
focusableyeskeyboardTabEscapefocus trapyesEscapedismissesDependencies
Installed automatically as transitive dependencies of slintcn add dialog.