Skip to content

2.4

Drawer ​

The Drawer component is a panel that slides out from the edge of the screen. It can be useful when you need users to complete a task or view some details without leaving the current page.

Import ​

js
import {
  MpDrawer,
  MpDrawerOverlay,
  MpDrawerContent,
  MpDrawerCloseButton,
  MpDrawerHeader,
  MpDrawerBody,
  MpDrawerFooter
} from '@mekari/pixel3'

Playground ​

API ​

MpDrawer ​

Props
Events
Slots
NameTypeDefault
id
Id of drawer.
string -
is-open
If true, drawer will open.
booleanfalse
is-block-scroll-on-mount
If true, scrolling will be only active in drawer body.
booleantrue
is-close-on-esc
If true, pressing esc key drawer will close.
booleantrue
is-close-on-overlay-click
If true, when overlay clicked drawer will close.
booleantrue
is-keep-alive
If true, drawer will be hidden using CSS instead of destroying DOM.
booleanfalse
is-disable-focus-trap
If true, focus trap will be disabled.
booleanfalse
placement
Placement of drawer.
"left" | "right" | "top" | "bottom"right
size
Size of drawer.
"sm" | "md" | "lg" | "xl" | "2xl" | "full";md
variant
Variant of drawer.
"default" | "floating"default

MpDrawerContent ​

Slots
NameType
default
Drawer content slot
any

MpDrawerHeader ​

Slots
NameType
default
Drawer header slot
any

MpDrawerBody ​

Slots
NameType
default
Drawer body slot
any

MpDrawerFooter ​

Slots
NameType
default
Drawer footer slot
any

Usage ​

Basic ​

Size ​

Variant ​

The floating variant displays the drawer as a card with rounded corners and margin from edges. Use only MpDrawerBody for content layout to preserve the rounded styling.