packages/components/layout/eui-app/eui-app-top-message/top-message.component.ts
Banner component displayed at the top of the application shell to communicate important system-wide messages. Automatically adjusts application layout by reserving vertical space and updating CSS variables for proper content positioning. Supports dismissible messages, custom content projection, and theme variants through BaseStatesDirective. Integrates with EuiAppShellService to coordinate layout calculations and viewport changes.
Example :<eui-app>
<eui-app-top-message euiDanger>
Test message for App top message
</eui-app-top-message>
</eui-app>
AfterViewInit
OnInit
OnDestroy
| changeDetection | ChangeDetectionStrategy.Default |
| encapsulation | ViewEncapsulation.None |
| HostDirectives |
BaseStatesDirective
Inputs : euiPrimary euiInfo euiWarning euiSuccess euiDanger euiVariant
|
| selector | eui-app-top-message |
| imports |
EUI_ICON_BUTTON
|
| templateUrl | ./top-message.component.html |
| styleUrl | ./top-message.scss |
Properties |
Methods |
Inputs |
Outputs |
HostBindings |
Accessors |
| hasCustomContent |
Type : boolean
|
Default value : false
|
|
Indicates that custom HTML content is projected into the message area. When true, applies specific styling to accommodate non-standard message layouts. |
| isCloseable |
Type : boolean
|
Default value : false
|
|
Enables a close button allowing users to dismiss the top message. When true, displays an icon button that triggers the topMessageClose event and hides the message. |
| isVisible |
Type : boolean
|
|
Controls the visibility state of the top message banner. When changed, triggers layout recalculation to adjust application content positioning. Setting to false collapses the message and releases reserved vertical space. |
| topMessageClose |
Type : EventEmitter
|
|
Emitted when the user clicks the close button on a dismissible message. Payload: null Triggered only when isCloseable is true and the close button is clicked. |
| attr.role |
Type : string
|
Default value : 'banner'
|
| class |
Type : string
|
| onCloseClick |
onCloseClick()
|
|
Returns :
void
|
| appTopMessage |
Type : ElementRef
|
Decorators :
@ViewChild('appTopMessage')
|
| appTopMessageChanges |
Type : Subscription
|
| asService |
Type : unknown
|
Default value : inject(EuiAppShellService)
|
| role |
Type : string
|
Default value : 'banner'
|
Decorators :
@HostBinding('attr.role')
|
| cssClasses |
getcssClasses()
|
| isVisible | ||||||
getisVisible()
|
||||||
setisVisible(value: boolean)
|
||||||
|
Controls the visibility state of the top message banner. When changed, triggers layout recalculation to adjust application content positioning. Setting to false collapses the message and releases reserved vertical space.
Parameters :
Returns :
void
|