Skip to main content

BwDrawer | bw-drawer

Overview

The drawer component is a modal that slides in from the side of the screen.

Usage

Sides

Open Drawer Left

Drawer Title

Drawer content

Ok
Open Drawer Right

Drawer Title

Drawer content

Ok
<div style="display: flex; gap: 8px; padding-bottom: 4px; align-items: center;">
<bw-drawer side="left">
<bw-button slot="trigger">Open Drawer Left</bw-button>
<bw-toolbar slot="header">
<h2>Drawer Title</h2>
</bw-toolbar>
<div slot="content">
<p>Drawer content</p>
</div>
<bw-toolbar slot="footer">
<bw-button slot="end">Ok</bw-button>
</bw-toolbar>
</bw-drawer>
<bw-drawer side="right">
<bw-button slot="trigger">Open Drawer Right</bw-button>
<bw-toolbar slot="header">
<h2>Drawer Title</h2>
</bw-toolbar>
<div slot="content">
<p>Drawer content</p>
</div>
<bw-toolbar slot="footer">
<bw-button slot="end">Ok</bw-button>
</bw-toolbar>
</bw-drawer>
</div>

Properties

PropertyAttributeDescriptionTypeDefault
backdropDismissbackdrop-dismissBackdrop will dismiss the drawer on click when enabledbooleantrue
destroydestroyExecute a promise after the drawer has dismissed() => void | Promise<void>undefined
initinitExecute a promise before the drawer starts presenting() => void | Promise<void>undefined
openopenOpens and closes the drawerbooleanfalse
sidesideWhere the drawer will appear on the screen"left" | "right"'left'

Events

EventDescriptionType
drawerDismissEmitted when the drawer is dismissedCustomEvent<{ role?: string; data?: any; }>
drawerPresentEmitted when the drawer is presentedCustomEvent<any>
readyEmitted when the component has completed it's first renderCustomEvent<any>

Methods

dismiss(role?: string, data?: any) => Promise<void>

Dismisses the drawer

Parameters

NameTypeDescription
rolestring- The role of the dismiss
dataany- The data of the dismiss

Returns

Type: Promise<void>

present() => Promise<void>

Presents the drawer

Returns

Type: Promise<void>

Slots

SlotDescription
"content"The content of the drawer
"footer"The footer of the drawer
"header"The header of the drawer
"trigger"The trigger element of the drawer

Shadow Parts

PartDescription
"dialog"The dialog element
"inner-container"The inner container of the drawer

CSS Custom Properties

NameDescription
--backgroundThe background color of the drawer
--colorThe color of the drawer
--widthThe width of the drawer

© 2025 United Systems & Software - All Rights Reserved.