Skip to content

Drawer

A panel that slides out from the edge of the screen to display side content or forms.

Basic Usage

Status: Closed

Example

Direction

Example

Sizes

Example

Close Button

Example

API

Props

NameTypeDefaultDescription
openbooleanfalseWhether the drawer is open
defaultOpenbooleanfalseDefault open state
directionstring'bottom'Direction: top, bottom, left, right
dismissiblebooleantrueWhether the drawer can be dismissed
modalbooleantrueWhether the drawer is modal

DrawerContent Props

NameTypeDefaultDescription
showHandlebooleanfalseWhether to show the handle
showClosebooleanfalseWhether to show the close button
classstring-Custom class
shouldScaleBackgroundbooleanfalseWhether to scale background
activeSnapPointstring | number-Active snap point

Slots

NameDescription
defaultTrigger content
contentDrawer content
headerHeader content
footerFooter content

Emits

EventDescriptionParameters
update:openFired when open state changes(value: boolean)
closeFired when closed-

Usage Example

vue
<script setup lang="ts">
import { ref } from 'vue'
import { BrButton, BrDrawer, BrDrawerContent, BrDrawerHeader, BrDrawerTitle, BrDrawerTrigger } from '@breezeui/vue'

const isOpen = ref(false)
</script>

<template>
  <BrDrawer v-model:open="isOpen">
    <BrDrawerTrigger>
      <BrButton>Open Drawer</BrButton>
    </BrDrawerTrigger>
    <BrDrawerContent>
      <BrDrawerHeader>
        <BrDrawerTitle>Title</BrDrawerTitle>
      </BrDrawerHeader>
      <div>Content...</div>
    </BrDrawerContent>
  </BrDrawer>
</template>