packages/components/layout/eui-app/eui-app-header/header.component.ts
Application header component that provides a top-level banner area for branding, navigation, and global actions. Automatically registers with EuiAppShellService to coordinate layout calculations and CSS variable management. Supports automatic header shrinking on scroll to maximize content area when user scrolls down the page. Integrates with Angular CDK ScrollDispatcher for optimized scroll event handling outside Angular zone. Includes built-in sidebar toggle integration for responsive navigation control.
Example :<!-- Basic app header -->
<eui-app>
<eui-app-header>
<eui-header>
<eui-header-logo></eui-header-logo>
<eui-header-environment>DEV</eui-header-environment>
<eui-header-app>
<eui-header-app-name><strong>My</strong>Workplace</eui-header-app-name>
<eui-header-app-subtitle>Dashboard</eui-header-app-subtitle>
</eui-header-app>
<eui-header-user-profile>
<!-- User profile menu -->
</eui-header-user-profile>
</eui-header>
</eui-app-header>
</eui-app>
<!-- With shrink on scroll -->
<eui-app [isShrinkHeaderActive]="true">
<eui-app-header [isShrinkHeaderActive]="true">
<eui-header>
<!-- Header content -->
</eui-header>
</eui-app-header>
</eui-app>
| changeDetection | ChangeDetectionStrategy.Default |
| encapsulation | ViewEncapsulation.None |
| selector | eui-app-header |
| imports |
AsyncPipe
EuiSidebarToggleComponent
|
| templateUrl | ./header.component.html |
| styleUrl | ./header.scss |
Properties |
Inputs |
HostBindings |
Accessors |
| isShrinkHeaderActive |
Type : boolean
|
|
Enables automatic header height reduction when user scrolls down the page. When true, monitors viewport scroll position and applies shrinked styling to reduce header height, maximizing content area. |
| attr.role |
Type : string
|
Default value : 'banner'
|
| class |
Type : string
|
| asService |
Type : unknown
|
Default value : inject(EuiAppShellService)
|
| role |
Type : string
|
Default value : 'banner'
|
Decorators :
@HostBinding('attr.role')
|
| cssClasses |
getcssClasses()
|
| isShrinkHeaderActive | ||||||
getisShrinkHeaderActive()
|
||||||
|
Enables automatic header height reduction when user scrolls down the page. When true, monitors viewport scroll position and applies shrinked styling to reduce header height, maximizing content area.
Returns :
boolean
|
||||||
setisShrinkHeaderActive(value: BooleanInput)
|
||||||
|
Parameters :
Returns :
void
|