Dialog
import { BaseDialog } from "material.slint";export component Example inherits Window { width: 400px; height: 300px; background: transparent; BaseDialog { title: "Confirm Action"; default_action_text: "OK"; actions: ["Cancel"]; }}
A Dialog
is a modal overlay that appears on top of the main content to present important information or request user input. It can contain various content and action buttons.
Properties
Section titled “Properties”actions
Section titled “actions”[string] default: ""
An array of text labels for secondary action buttons.
default_action_text
Section titled “default_action_text”string default: ""
The text for the primary action button (typically “OK” or “Confirm”).
image default: the empty image
An optional icon displayed at the top of the dialog.
icon_actions
Section titled “icon_actions”[image] default: the empty image
An array of icon buttons displayed in the dialog’s action area.
string default: ""
The title text displayed at the top of the dialog.
Callbacks
Section titled “Callbacks”action(index: int)
Section titled “action(index: int)”Invoked when a secondary action button is clicked.
BaseDialog { action(index) => { debug("Action clicked at index: ", index); }}
close()
Section titled “close()”Invoked when the dialog is closed (e.g., by clicking outside or pressing Escape).
BaseDialog { close() => { debug("Dialog closed"); }}
default_action()
Section titled “default_action()”Invoked when the default action button is clicked or when Enter is pressed.
BaseDialog { default_action() => { debug("Default action clicked"); }}
icon_action(index: int)
Section titled “icon_action(index: int)”Invoked when an icon action button is clicked.
BaseDialog { icon_action(index) => { debug("Icon action clicked at index: ", index); }}
© 2025 SixtyFPS GmbH