Appearance
Function: alert()
ts
function alert(ctx: Context, options: AlertOptions): Promise<{
button: "cancel" | "confirm";
}>;Defined in: src/renderer/templates/alert.ts:40
Experimental
Show a blocking alert dialog with a title, description, and two buttons (Cancel + Confirm). Composed of Modal + HeaderBar + Text + NavigationBar — no new component primitives.
Awaits user click and resolves with the clicked button value.
Parameters
| Parameter | Type |
|---|---|
ctx | Context |
options | AlertOptions |
Returns
Promise<{ button: "cancel" | "confirm"; }>
Example
ts
import {alert} from '@matterway/sdk/UI';
const {button} = await alert(ctx, {
title: "Delete 'Onboarding Workflow'?",
description: 'This will permanently remove the workflow and all its data.',
confirmLabel: 'Delete',
});
if (button === 'confirm') {
await deleteWorkflow();
}