import{ ElDmDrawer, register }from'@duskmoon-dev/el-drawer';// Register with default tag nameregister();// Or register with custom tag name
customElements.define('my-drawer', ElDmDrawer);
Positions
Position
Description
left
Slide from left (default)
right
Slide from right
top
Slide from top
bottom
Slide from bottom
Attributes
Attribute
Type
Default
Description
open
boolean
false
Whether the drawer is open
position
string
'left'
Position: left, right, top, bottom
modal
boolean
true
Show backdrop overlay
width
string
'300px'
Drawer width (for left/right)
Slots
Slot
Description
(default)
Drawer body content
header
Drawer header
footer
Drawer footer
CSS Parts
Part
Description
drawer
The drawer element
backdrop
The backdrop overlay
content
The content wrapper
header
The header section
body
The body section
footer
The footer section
Events
Event
Detail
Description
open
-
Fired when drawer opens
close
-
Fired when drawer closes
Examples
Basic
<el-dm-buttononclick="document.querySelector('#drawer').open = true">
Open Drawer
</el-dm-button><el-dm-drawerid="drawer"><spanslot="header">Menu</span><nav><ahref="#">Home</a><ahref="#">About</a><ahref="#">Contact</a></nav></el-dm-drawer>