On this page

Sheet

Install, props and the parts Sheet is built from.

Install

Run this in the app, after shadcn-vue init and the Beehexa theme (Button › Code):

npx shadcn-vue@latest add https://beehexa.design/r/sheet.json

Use

<script setup lang="ts">
import { Button } from '@/components/ui/button'
import {
  Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger,
} from '@/components/ui/sheet'
</script>

<template>
  <Sheet>
    <SheetTrigger as-child>
      <Button variant="outline">Edit store</Button>
    </SheetTrigger>
    <SheetContent close-label="Close">
      <SheetHeader>
        <SheetTitle>Edit store</SheetTitle>
        <SheetDescription>Changes apply to the next sync.</SheetDescription>
      </SheetHeader>
      <!-- body: px-(--bh-space-modal) -->
      <SheetFooter>
        <SheetClose as-child><Button variant="outline">Cancel</Button></SheetClose>
        <Button>Save</Button>
      </SheetFooter>
    </SheetContent>
  </Sheet>
</template>

Props

Part Prop Values Notes
Sheet open, defaultOpen boolean Controlled (v-model:open) or initial state
SheetContent side right (default), left, top, bottom The edge it slides in from
SheetContent showCloseButton boolean, default true The close button at the top end
SheetContent closeLabel string, default Close The close button’s name. Beehexa addition: set it in the page’s language
SheetTrigger, SheetClose as-child boolean Use it, so the trigger is your Button

Built on

The reka-ui Dialog, with the shadcn-vue Sheet API, as control-center uses it. reka-ui gives role="dialog", aria-modal, the focus trap, Esc and returning focus. Beehexa adds the styles and closeLabel. Needs the Button registry item.

Limitations

  • The slide uses the shadcn-vue animation classes, not motion.modal.enter and .exit yet.