D3vugu-components/components/overlay/toast-simple.go

25 lines
521 B
Go
Raw Permalink Normal View History

package overlay
import (
"time"
"github.com/vugu/vugu"
)
type ToastSimple struct {
IconSlot vugu.Builder `vugu:"data"` // Slot for the symbol.
Message string `vugu:"data"`
Duration time.Duration // Auto close toast after this duration.
SignalColor string // A d3c CSS class for the color scheme of the small bar.
}
func (c *ToastSimple) OverlayClasses() (signalClasses, containerClasses string) {
return c.SignalColor, ""
}
func (c *ToastSimple) ToastDuration() time.Duration {
return c.Duration
}