lotusui the ikaito design language for Gio — desktop, mobile, web
GitHub

AlertDialog

The interruption that requires a decision — no backdrop dismissal.

A Dialog that absorbs every outside click and Escape and offers exactly Cancel and Action. Poll Confirmed/Cancelled each frame while open; lay it out at window constraints like Dialog.

Installation

Use the module import (the default), or own the source: lotusui add vendors the component into your app and lotusui update keeps the copy mergeable — see Registry.

Go
go get github.com/ikaito-com/lotusui

# or vendor the source into your app:
go run github.com/ikaito-com/lotusui/cmd/lotusui add alert-dialog

Usage

Go
var confirm lotusui.AlertDialog
var open bool

if deleteBtn.Clicked(gtx) { open = true; confirm.Appear() }
if open {
	if confirm.Confirmed(gtx) { open = false; doDelete() }
	if confirm.Cancelled(gtx) { open = false }
	confirm.Layout(th, gtx, lotusui.AlertDialogOpts{
		Title:       "Are you absolutely sure?",
		Description: "This action cannot be undone. This will permanently delete your account.",
	})
}

Destructive

Destructive: true turns the action red; Media renders a medallion above the title; Size picks the width preset.

Go
confirm.Layout(th, gtx, lotusui.AlertDialogOpts{
	Size: lotusui.SizeSM, Title: "Delete chat?",
	Description: "This will permanently delete this chat conversation.",
	Action: "Delete", Destructive: true, Media: dangerMedallion,
})

Small

Go
confirm.Layout(th, gtx, lotusui.AlertDialogOpts{
	Size: lotusui.SizeSM, Title: "Allow accessory to connect?",
	Description: "Do you want to allow the USB accessory to connect to this device?",
	Cancel: "Don't allow", Action: "Allow",
})

API

OptionTypeDescription
Appear()methodRestart the entrance animation on the closed→open transition.
Confirmed(gtx) / Cancelled(gtx)boolPoll each frame while open.
Title / DescriptionstringThe decision's copy.
Cancel / ActionstringButton labels; empty = Cancel / Continue.
SizeSizeDialog width preset (Size2XS…Size2XL).
Medialayout.WidgetRenders above the title — an icon medallion, an image.
DestructiveboolRenders the action destructively.

Every demo on this site is the real Go component compiled to WebAssembly — one gallery app, one bundle, addressed by URL hash.