D3vugu-components/components/overlay/interfaces.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

16 lines
623 B
Go

package overlay
import "time"
// OverlayClassesGetter can be implemented by components that are used in overlays.
// With this mechanic these components can set additional CSS classes to the modal or toast container.
// One use case is to give a toast or modal some other color with the `d3c-color-*` classes.
type OverlayClassesGetter interface {
OverlayClasses() (signalClasses, containerClasses string)
}
// ToastDurationGetter can be implemented by toast components to signal that the toast should close automatically after some given duration.
type ToastDurationGetter interface {
ToastDuration() time.Duration
}