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

Alert

The static callout: icon, title, description — it informs, never acts.

A bordered, tinted box with an icon, a title and an optional description. For interruptions that require action, use AlertDialog.

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

Usage

Go
lotusui.Alert(th, lotusui.AlertOpts{
	Title:       "Heads up!",
	Description: "You can vendor any component into your app with the CLI.",
})

Destructive

Danger ink on the danger tint; the icon defaults to the warning glyph.

Go
lotusui.Alert(th, lotusui.AlertOpts{
	Variant: lotusui.AlertDestructive,
	Title:   "Your session has expired",
})

With action

Action renders at the alert's end — typically a small button.

Go
lotusui.Alert(th, lotusui.AlertOpts{
	Title:       "Dark mode is now available",
	Description: "Enable it under your profile settings to get started.",
	Action:      lotusui.Button(th, &enable, "Enable", lotusui.ButtonOpts{Size: lotusui.SizeXS}),
})

Colors

Color re-tints the whole alert from any ColorScale, the pastel way — tinted well, deep same-hue ink, readability preserved by construction.

Go
lotusui.Alert(th, lotusui.AlertOpts{
	Color: lotusui.Orange,
	Title: "Your subscription will expire in 3 days.",
})

API

OptionTypeDescription
VariantAlertVariantAlertDefault, AlertDestructive.
IconstringOverrides the variant's default (info / warning).
Title / DescriptionstringDescription optional.
Actionlayout.WidgetRendered at the end — typically a small Button.
ColorColorScaleRe-tints the alert the pastel way from any scale.

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