packages/components/layout/eui-app/eui-app-sidebar/sidebar-drawer/sidebar-drawer.component.ts
Expandable drawer component that slides out from the sidebar to display additional content or details. Provides a secondary panel for contextual information, settings, or extended navigation without leaving the current view. Manages expanded/collapsed state with corresponding CSS classes for animation and positioning. Prevents event propagation from drawer content to avoid unintended sidebar interactions.
Example :<!-- Sidebar drawer for user profile details -->
<eui-app>
<eui-app-sidebar>
<eui-app-sidebar-header>
<eui-app-sidebar-header-user-profile
(toggle)="onSidebarProfileToggle($event)"
[hasProfileDrawer]="true">
</eui-app-sidebar-header-user-profile>
</eui-app-sidebar-header>
<eui-app-sidebar-drawer [isExpanded]="drawerExpanded">
<p><strong>User Profile Details</strong></p>
<p>Additional user information and settings</p>
</eui-app-sidebar-drawer>
<eui-app-sidebar-body>
<eui-app-sidebar-menu [items]="sidebarItems"></eui-app-sidebar-menu>
</eui-app-sidebar-body>
</eui-app-sidebar>
</eui-app>drawerExpanded = false;
onSidebarProfileToggle(event: any): void {
this.drawerExpanded = !this.drawerExpanded;
}| encapsulation | ViewEncapsulation.None |
| selector | eui-app-sidebar-drawer |
| templateUrl | ./sidebar-drawer.component.html |
Methods |
|
Inputs |
HostBindings |
Accessors |
| isExpanded |
Type : boolean
|
|
Controls the expanded/collapsed state of the drawer panel. When true, drawer slides out to display its content. When false, drawer is hidden. Accepts boolean or boolean-coercible values (string 'true'/'false', empty attribute). |
| class |
Type : string
|
| Public onSidebarDrawerContentClick | ||||||
onSidebarDrawerContentClick(event: Event)
|
||||||
|
Parameters :
Returns :
void
|
| isExpanded | ||||||
getisExpanded()
|
||||||
|
Controls the expanded/collapsed state of the drawer panel. When true, drawer slides out to display its content. When false, drawer is hidden. Accepts boolean or boolean-coercible values (string 'true'/'false', empty attribute).
Returns :
boolean
|
||||||
setisExpanded(value: BooleanInput)
|
||||||
|
Parameters :
Returns :
void
|
| cssClasses |
getcssClasses()
|