mirror of
https://github.com/anotherhadi/ilovetui.git
synced 2026-08-21 12:05:49 +02:00
21b574eb6f
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
notification
Toast notifications, triggered from anywhere in a bubbletea program via an exported tea.Msg
(ShowMsg/Show), not a direct reference to the Model that renders them. Composites over an
already-rendered string, so it makes no assumption about how the host builds that string.
- Four kinds:
Info,Success,Warning,Error, each with its ownstyle.Scolor preset. - Auto-dismisses after
DefaultDuration(3s) unless shown withWithDuration(0), which makes it sticky; a sticky toast needsWithIDsoDismiss(id)can remove it later. - Six anchors (
Top,TopLeft,TopRight,Bottom,BottomLeft,BottomRight). Toasts stack along the anchored edge, newest closest to it. WithMaxWidthcaps growth; a toast narrower than the cap shrinks to fit instead.
See examples/notification.