lotusui
A Go design system for desktop and mobile — one codebase, native apps. Web when you want it.
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

open demo ↗

Destructive

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

open demo ↗

Small

open demo ↗

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).
SizesResponsiveSizeStepped Size; when Set(), overrides Size.
Width / Widthsunit.Dp / ResponsiveDpFree-form or stepped width; Widths wins when Set().
Medialayout.WidgetRenders above the title — an icon medallion, an image.
DestructiveboolRenders the action destructively.

lotusui is a Go design system for native desktop and mobile — and the web when you want it. Docs demos are the real components (WebAssembly) — one gallery app, each Preview an iframe addressed by URL hash.