Documentation
¶
Overview ¶
Package banner provides the banner component and interactions with that component.
https://github.com/material-components/material-components-web/tree/master/packages/mdc-banner
Index ¶
Constants ¶
const API = autoinit.MDCBanner
API is the auto init data value for this component.
const ReasonTag = "reason"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Banner ¶
type Banner struct { app.Compo base.JsUtil autoinit.AutoInit Id string Text string Centered bool Fixed bool Stacked bool Buttons []app.UI // contains filtered or unexported fields }
Banner component displays a prominent message and related optional actions.
See https://github.com/material-components/material-components-web/tree/master/packages/mdc-banner#banner-example for usage of the Banner fields.
func (*Banner) ActionClose ¶
func (b *Banner) ActionClose(ctx app.Context, reason CloseReason)
ActionClose sends the Close event to the banner component with the provided reason.
func (*Banner) ActionOpen ¶
ActionOpen sends the Open event to the banner component.
func (*Banner) OnClose ¶ added in v0.2.4
OnClose registers the onClose callback function to handle the Close event emitted by the banner js.
type CloseReason ¶ added in v0.2.4
type CloseReason string
const ClosePrimary CloseReason = "primary"
const CloseSecondary CloseReason = "secondary"
const CloseUnspecified CloseReason = "unspecified"
func (CloseReason) Int ¶ added in v0.2.4
func (bcr CloseReason) Int() int
type CloseReasonInt ¶ added in v0.2.4
type CloseReasonInt int
const ClosePrimaryInt CloseReasonInt = 0
const CloseSecondaryInt CloseReasonInt = 1
const CloseUnspecifiedInt CloseReasonInt = 3
type EventType ¶
type EventType string
EventType defines the event strings that are sent to and from the banner control.
const Close EventType = "MDCBanner:close"
Close is the event sent using OnClose to call the banner's api.close() method
const Closed EventType = "MDCBanner:closed"
Closed indicates when the banner finishes its closing animation.
const Closing EventType = "MDCBanner:closing"
Closing indicates when the banner begins its closing animation.
const Open EventType = "MDCBanner:open"
Open is the event sent using ActionOpen to call the banner's api.open() method.
const Opened EventType = "MDCBanner:opened"
Opened indicates when the banner finishes its opening animation.
const Opening EventType = "MDCBanner:opening"
Opening indicates when the banner begins its opening animation.