Headless-like side appearing drawer with backdrop. You must provide content (with styles) for button and drawer via slots. Button position is controlled by putting Drawer Component anywhere you like. Drawer position is controlled via position prop.
Props
prop
description
type
default value
width
width of drawer in px
number
260
position
position of drawer
"left", "right"
"left"
duration
duration of drawer animation in ms
number
150
Slots
slot
description
button-open
content inside button when drawer is not visible, usually "hamburger" icon
button-close
content inside button when drawer is visible, usually "x" icon
content
content inside drawer
Styling
CSS variable
description
fallback value
--backdrop-color
color of backdrop
rgba(0, 0, 0, 0.75)
Additional features
You can close drawer from child component via closeDrawer callback from context: