class Opal::UI::ToastManager

Overview

Manages a collection of toast notifications and renders them over a target buffer.

Defined in:

opal/ui/components/toast.cr

Instance Method Summary

Instance Method Detail

def add(title : String, message : String = "", level : Symbol = :info, duration_ms : Int64 = 4000_i64) : Toast #

[View source]
def any? : Bool #

[View source]
def clean_expired(now : Time::Instant = Time.instant) : Nil #

[View source]
def render_overlay(buffer : Buffer, position : Symbol = :top_right, now : Time::Instant = Time.instant) : Nil #

Renders all active toasts stacked in the top-right corner of the buffer


[View source]
def size : Int32 #

[View source]
def toasts : Array(Toast) #

[View source]