D3vugu-components/components/overlay/toast-simple.go
David Vogel 69160e02c4 Add timeout/duration option to toasts
- Rename overlay-classes.go to interfaces.go
- Add event parameter to AddToast method
- Update overlay example page
2023-05-28 15:04:18 +02:00

25 lines
521 B
Go

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
}