drawer

Drawer

A panel that slides in from any edge and closes with a swipe, with snap points for a half-open state, such as filters or a mini cart on a phone.

Parts

PartFileDoes
DrawerDrawer.vueGroups all parts of the drawer.
DrawerBodyDrawerBody.vueHolds the drawer's main content and scrolls it when the drawer reaches its height cap, keeping the header and footer in view.
DrawerCloseDrawerClose.vueCloses the drawer.
DrawerContentDrawerContent.vueHolds what the drawer shows while open.
DrawerDescriptionDrawerDescription.vueExplains the purpose of the drawer below its title.
DrawerFooterDrawerFooter.vueHolds the actions of the drawer, such as apply and cancel buttons.
DrawerHeaderDrawerHeader.vueGroups the title and description at the top of the drawer.
DrawerOverlayDrawerOverlay.vueCovers the page behind the open drawer.
DrawerTitleDrawerTitle.vueNames the drawer.
DrawerTriggerDrawerTrigger.vueOpens the drawer.

Anatomy

<Drawer>
  <DrawerTrigger />
  <DrawerContent>
    <DrawerHeader>
      <DrawerTitle />
      <DrawerDescription />
    </DrawerHeader>
    <DrawerBody />
    <DrawerFooter>
      <DrawerClose />
    </DrawerFooter>
  </DrawerContent>
</Drawer>

Styling

All of Drawer’s styles live in drawer.json. New to styling in Frontic UI? How styling works →

Install

Installs with it
focus
npm packages
@vueuse/core
class-variance-authority
reka-ui

API reference

Drawer.vue

Groups all parts of the drawer.

Props 8

PropTypeDefault
openboolean—
defaultOpenbooleanfalse
modalDrawerModaltrue
swipeDirectionSwipeDirection'down'
snapPointsDrawerSnapPoint[]—
snapPointDrawerSnapPoint | null—
defaultSnapPointDrawerSnapPoint | null—
snapToSequentialPointsbooleanfalse

Events 3

EventPayload
update:openvalue: boolean, details: DrawerOpenChangeDetails
update:openCompletevalue: boolean
update:snapPointvalue: DrawerSnapPoint | null

Slots 1

SlotSlot props
default{ open: boolean; close: () => void; }

DrawerBody.vue

DrawerClose.vue

DrawerContent.vue

DrawerDescription.vue

DrawerFooter.vue

DrawerHeader.vue

DrawerOverlay.vue

DrawerTitle.vue

DrawerTrigger.vue
Drawer