lotusui
A Go design system for desktop and mobile — one codebase, native apps. Web when you want it.
GitHub

Toast

Transient notifications: bottom-right stack, auto-dismissing.

Toaster owns the queue: Add from anywhere, Layout ONCE per frame at window constraints (the same portal rule as Dialog). Each toast dismisses after its duration; destructive toasts carry danger ink.

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 toast

Usage

open demo ↗

Types

Success, info and warning color the title's ink; destructive colors everything.

open demo ↗

Promise

The in-flight pattern: Add a Loading toast under an ID, then Update the same ID with the outcome — it replaces in place and restarts the clock.

open demo ↗

API

OptionTypeDescription
Toaster.Add(Toast)methodEnqueue from anywhere; safe during event handling.
Toaster.Update(id, Toast)methodReplace the live toast with that ID in place — the promise pattern.
Toast.Title / DescriptionstringThe notification's copy.
Toast.VariantToastVariantToastDefault, ToastDestructive, ToastSuccess, ToastInfo, ToastWarning.
Toast.IDstringNames the toast for Update.
Toast.LoadingboolA spinner before the title.
Toast.Durationtime.DurationAuto-dismiss delay; zero means 4s.

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.