Skip to content

Drawer

Overlay panel that slides in from the screen edge.

Basic Usage

Control visibility with v-model. Defaults to sliding in from the right.

vue
<script setup>
import { ref } from 'vue'
const show = ref(false)
</script>

<ABtn @click="show = true">Right Drawer</ABtn>
<ADrawer v-model="show" title="Drawer Title">
  This is the drawer content area.
</ADrawer>

Slide from Left

Set placement="left" to slide from the left.

vue
<ADrawer v-model="show" placement="left" title="Left Drawer">
  Content
</ADrawer>

API

Props

NameTypeDefaultDescription
modelValuebooleanfalseVisibility
placement'left' | 'right' | 'top' | 'bottom''right'Slide direction
widthstring'300px'Left/right drawer width
heightstring'300px'Top/bottom drawer height
titlestringTitle
closablebooleantrueShow close button
maskClosablebooleantrueClose on mask click

Events

NameDescription
update:modelValueVisibility changed
openDrawer opened
closeDrawer closed

Slots

NameDescription
defaultBody content
headerCustom header

Interaction

  • Mask fade-in + panel ease-out slide
  • Mask click closes
  • Esc key closes
  • Body scroll locked on open

MIT License