On this page

Sheet

Live examples of Sheet, with the exact Vue file that renders each one.

Every example is a complete Vue file. Copy it into an app that has the registry installed, or open it in StackBlitz. Press the button to open each sheet.

Edit a record

A short form. lg:max-w-md narrows the sheet to the form; the actions are at the bottom, Cancel first and the primary action last.

SheetEditForm.vue
<script setup lang="ts">
import { ref } from 'vue'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import {
  Sheet,
  SheetClose,
  SheetContent,
  SheetDescription,
  SheetFooter,
  SheetHeader,
  SheetTitle,
  SheetTrigger,
} from '@/components/ui/sheet'

const open = ref(false)
const name = ref('Main online store')
const url = ref('https://shop.example.com')
</script>

<template>
  <Sheet v-model:open="open">
    <SheetTrigger as-child>
      <Button variant="outline">Edit store</Button>
    </SheetTrigger>
    <SheetContent class="lg:max-w-md" close-label="Close">
      <SheetHeader>
        <SheetTitle>Edit store</SheetTitle>
        <SheetDescription>Changes apply to the next sync.</SheetDescription>
      </SheetHeader>
      <form id="edit-store" class="grid gap-(--bh-space-200) px-(--bh-space-modal)" @submit.prevent="open = false">
        <div class="grid gap-(--bh-space-050)">
          <Label for="store-name">Store name</Label>
          <Input id="store-name" v-model="name" />
        </div>
        <div class="grid gap-(--bh-space-050)">
          <Label for="store-url">Store URL</Label>
          <Input id="store-url" v-model="url" type="url" />
        </div>
      </form>
      <SheetFooter>
        <SheetClose as-child>
          <Button variant="outline">Cancel</Button>
        </SheetClose>
        <Button type="submit" form="edit-store">Save changes</Button>
      </SheetFooter>
    </SheetContent>
  </Sheet>
</template>

Show the details of a row

A data-inspection sheet keeps the default width: the whole window on phones, layout.overlay.default from breakpoint.lg.

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

const fields = [
  { label: 'Customer', value: 'An Nguyen' },
  { label: 'Channel', value: 'Online store' },
  { label: 'Total', value: '1,250,000 VND' },
  { label: 'Status', value: 'Waiting for ERP' },
]
</script>

<template>
  <Sheet>
    <SheetTrigger as-child>
      <Button variant="ghost">Order #10482</Button>
    </SheetTrigger>
    <!-- A data-inspection sheet: full width on phones, layout.overlay.default from breakpoint.lg. -->
    <SheetContent close-label="Close">
      <SheetHeader>
        <SheetTitle>Order #10482</SheetTitle>
        <SheetDescription>Placed on 12 November 2026 and not yet in the ERP.</SheetDescription>
      </SheetHeader>
      <dl class="grid grid-cols-[auto_1fr] gap-x-(--bh-space-300) gap-y-(--bh-space-100) overflow-y-auto px-(--bh-space-modal)">
        <template v-for="field in fields" :key="field.label">
          <dt class="text-(--bh-color-text-subtle)">{{ field.label }}</dt>
          <dd>{{ field.value }}</dd>
        </template>
      </dl>
    </SheetContent>
  </Sheet>
</template>