Skip to content

MazDrawer ​

MazDrawer is a panel that slides in from the top, the bottom, the left or the right side of the screen over a backdrop, for side menus, filters or details

Before use it, you should install the MazUi plugin in your project, follow instructions in Getting Started

TIP

This component uses <Teleport to="body"> with MazBackdrop, so you can implement this component anywhere and it inherits all its props

Basic usage ​

Accessibility ​

The drawer is a modal dialog labelled by its title. The focus is trapped inside while it is open, Esc closes it, and the rest of the page is inert (except the toasts and the live regions). The close button is labelled from @maz-ui/translations (aria.close).

Props ​

NameDescriptionTypeRequiredDefaultPossible values
titleThe title of the drawerstringNo--
variantThe edge from which the drawer slides in. start (= left in LTR, right in RTL) and end (= right in LTR, left in RTL) follow the document direction; top and bottom are physical."end" | "start" | "bottom" | "top"No"end"'end' | 'start' | 'bottom' | 'top'
sizeThe size of the drawer``${number}rem|${number}px|${number}em|${number}vw|${number}vh|${number}vmin|${number}vmax|${number}%|${number}ch|${number}cm|${number}mm|${number}in|${number}ex|${number}pc|${number...`No"30rem"-
backdrop-classThe class of the backdropstringNo--
hide-close-buttonDisable the close buttonbooleanNo--
model-valuev-model Value of v-model, forwarded to the inner componentbooleanNo--

Events ​

Event namePayloadDescription
update:model-valuevalue: booleanemitted when drawer is open or close
open-emitted when drawer is open
close-emitted when drawer is close (after animation)
before-close-emitted before drawer is close

Slots ​

NameDescriptionBindings
titleclose () => void
defaultclose () => void