Overlay
Drawer
A panel that slides in from an edge of the viewport, or covers it, with the same modal behaviour as Dialog.
WAI-ARIA tested
Import
main.ts
import { Drawer } from '@vitral/vue';Positions
API
Read from packages/vue/src/components/Drawer/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| header | string | The title; it names the drawer. Without one, name it with `aria-label` or `aria-labelledby`. |
| position | DrawerPosition | The edge it slides in from, or `'full'` to cover the viewport. Defaults to `'left'`. |
| modal | boolean | Dim and block the page, trap focus and lock scrolling. Defaults to true. |
| dismissable | boolean | Close on a press on the mask. Defaults to true. |
| closeOnEscape | boolean | Defaults to true. |
| showCloseIcon | boolean | Show the close button. Defaults to true. |
| blockScroll | boolean | Lock the page's scroll even when the drawer is not modal. |
| appendTo | string | `'body'` (the default), `'self'` to render in place, or a selector. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| show | — | — |
| hide | — | — |
| after-hide | — | After the closing animation, once the drawer has left the page. |
Slots
| Name | Slot props | Description |
|---|---|---|
| default | — | — |
| header | — | Replaces the title text; it still names the drawer. |
| footer | — | — |
| closeicon | — | — |