Skip to main content

Module banner

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.
BannerContent
What an immediate-mode Banner::paint shows: severity, leading icon, title, optional message, up to two actions and whether it offers a dismiss control.
BannerHit
Where Banner::paint put the banner and its controls, for the caller’s hit-testing.
BannerNotice
What a state-bound banner shows (Banner::from_state).

Enums§

BannerKind
Severity of a Banner. Selects the icon and its colour.