Module banner
Expand description
Banner — an inline, semantic alert strip. Unlike a super::toast::Toast
(transient, auto-expiring) a banner is a persistent in-flow message the
person resolves or dismisses: “You’re offline — changes will sync when you
reconnect”, “This file has unsaved changes”, “You’re in a private window”.
A BannerKind decides the leading icon and its colour; the well, the
ink and the buttons come from the theme. A banner carries a title, an
optional secondary message, up to two actions laid out inside its box
at the trailing edge (they wrap under the message when the banner is
narrow), and an optional dismiss control. The actions and the dismiss
control are real Buttons: focusable, named, and published as actions,
so an app never places its own buttons beside a banner.
Banner::paint and Banner::height draw the same banner for a host
that paints into a Scene, and hand back where its buttons are.
Structs§
- Banner
- An inline semantic alert with a title, an optional message, up to two actions and an optional dismiss control.
- Banner
Content - What an immediate-mode
Banner::paintshows: severity, leading icon, title, optional message, up to two actions and whether it offers a dismiss control. - Banner
Hit - Where
Banner::paintput the banner and its controls, for the caller’s hit-testing. - Banner
Notice - What a state-bound banner shows (
Banner::from_state). - Banner
Props - A message that stays in the page until it is resolved or dismissed: “You’re offline”, “This file changed on disk”, “Storage is almost full”. Its kind decides its glyph and colour; it carries a title, a message under it, up to two actions inside its box, and a dismiss button. It opens and closes in place, what follows moving with its edge.
Enums§
- Banner
Kind - Severity of a
Banner. Selects the icon and its colour.