struct Opal::UI::Toast

Overview

Represents a single floating notification message.

Defined in:

opal/ui/components/toast.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(title : String, message : String = "", level : Symbol = :info, duration_ms : Int64 = 4000_i64, id : String = Random::Secure.hex(4), created_at : Time::Instant = Time.instant) #

[View source]

Instance Method Detail

def created_at : Time::Instant #

[View source]
def duration_ms : Int64 #

[View source]
def expired?(now : Time::Instant = Time.instant) : Bool #

[View source]
def id : String #

[View source]
def level : Symbol #

[View source]
def level_badge : Tuple(String, Color) #

[View source]
def message : String #

[View source]
def title : String #

[View source]