A non-modal notification banner that displays important, concise messages requiring user acknowledgement.
The banner slides into view with an animated grow transition and renders inline, pushing the surrounding page content rather than overlaying it.
The component supports the
Invoker Commands API.
A button with command="--show", "--hide" or "--toggle" and a
commandfor that points to this element calls the matching method.
- Element
-
igc-banner
- Slots
-
default— The banner message text content. -
prefix— An icon or illustration rendered before the message, reinforcing the message type. -
actions— Custom action elements rendered in the banner's action area. When provided, replaces the default "OK" dismiss button.
- CSS Parts
-
base— The root wrapper element of the banner. -
spacer— The inner wrapper that controls the spacing around the banner content. -
message— The container that holds the illustration and text content. -
illustration— The container for the prefix slot (icon/illustration). -
content— The container for the default message slot. -
actions— The container for the action buttons slot.
Properties
Section titled "Properties"Whether the banner is open.
Setting it skips the animation and the close events. Use the show(),
hide() and toggle() methods for an animated transition.
open: boolean = false Defined in src/components/banner/banner.ts:100
tagName
Section titled "tagName"The tagName read-only property of the Element interface returns the tag name of the element on which it's called.
tagName: "igc-banner" = 'igc-banner' Defined in src/components/banner/banner.ts:59
Methods
Section titled "Methods"Closes the banner with an animated grow-out transition.
Returns true when the banner was successfully closed, or false if it
was already closed or closing, the transition was superseded by a newer
one, or open was set to false and then to true during it.
hide(): Promise<boolean> Defined in src/components/banner/banner.ts:138
Returns Promise<boolean>
Opens the banner with an animated grow-in transition.
Returns true when the banner was successfully opened, or false if it
was already open or opening, the transition was superseded by a newer one,
or open was set to false during it.
show(): Promise<boolean> Defined in src/components/banner/banner.ts:127
Returns Promise<boolean>
toggle
Section titled "toggle"Toggles the banner open or closed depending on its current state.
Equivalent to calling show() when closed and hide() when open.
Returns true when the transition completed successfully, with the same
false cases as these methods.
toggle(): Promise<boolean> Defined in src/components/banner/banner.ts:149