Sheet
Extends the Dialog component to display content that complements the main content of the screen.
Preview
Installation
npx sigma-ui@latest add sheetUsage
<script setup lang="ts">
import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
SheetTrigger,
} from '@/components/ui/sheet';
</script>
<template>
<Sheet>
<SheetTrigger>Open</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Are you absolutely sure?</SheetTitle>
<SheetDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</SheetDescription>
</SheetHeader>
</SheetContent>
</Sheet>
</template>Use v-model:open on Sheet to control the open state.
Examples
Side
Use the side property to <SheetContent /> to indicate the edge of the screen where the component will appear. The values can be top, right, bottom or left.
Size
You can adjust the size of the sheet using CSS classes:
<template>
<Sheet>
<SheetTrigger>Open</SheetTrigger>
<SheetContent class="w-[400px] sm:w-[540px]">
<SheetHeader>
<SheetTitle>Are you absolutely sure?</SheetTitle>
<SheetDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</SheetDescription>
</SheetHeader>
</SheetContent>
</Sheet>
</template>API Reference
Sheet
Props
| Prop | Type | Default |
|---|---|---|
openThe controlled open state of the dialog. Can be binded as | boolean | - |
defaultOpenThe open state of the dialog when it is initially rendered. Use when you do not need to control its open state. | boolean | - |
modalThe modality of the dialog When set to | boolean | - |
unmountOnHideWhen set to | boolean | true |
Events
| Event | Payload |
|---|---|
update:openEvent handler called when the open state of the dialog changes. | [value: boolean] |
Slots
| Slot | Scope |
|---|---|
defaultThe content of the component. | - |
SheetTrigger
Props
| Prop | Type | Default |
|---|---|---|
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
Slots
| Slot | Scope |
|---|---|
defaultThe content of the component. | - |
SheetClose
Props
| Prop | Type | Default |
|---|---|---|
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
Slots
| Slot | Scope |
|---|---|
defaultThe content of the component. | - |
SheetContent
Props
| Prop | Type | Default |
|---|---|---|
sideEdge of the screen the sheet slides in from. | "top" | "right" | "bottom" | "left" | null | - |
forceMountUsed to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries. | boolean | - |
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
disableOutsidePointerEventsWhen | boolean | - |
Events
| Event | Payload |
|---|---|
escapeKeyDownEvent handler called when the escape key is down. Can be prevented. | [event: KeyboardEvent] |
pointerDownOutsideEvent handler called when a | [event: PointerDownOutsideEvent] |
focusOutsideEvent handler called when the focus moves outside of the | [event: FocusOutsideEvent] |
interactOutsideEvent handler called when an interaction happens outside the | [event: PointerDownOutsideEvent | FocusOutsideEvent] |
openAutoFocusEvent handler called when auto-focusing on open. Can be prevented. | [event: Event] |
closeAutoFocusEvent handler called when auto-focusing on close. Can be prevented. | [event: Event] |
Slots
| Slot | Scope |
|---|---|
defaultThe content of the component. | - |
SheetHeader
Slots
| Slot | Scope |
|---|---|
defaultThe content of the component. | - |
SheetTitle
Props
| Prop | Type | Default |
|---|---|---|
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
Slots
| Slot | Scope |
|---|---|
defaultThe content of the component. | - |
SheetDescription
Props
| Prop | Type | Default |
|---|---|---|
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
Slots
| Slot | Scope |
|---|---|
defaultThe content of the component. | - |
SheetFooter
Slots
| Slot | Scope |
|---|---|
defaultThe content of the component. | - |
Accessibility
Adheres to the Dialog WAI-ARIA design pattern. Reka UI traps focus inside the open sheet and returns it to the trigger on close. SheetTitle and SheetDescription label the content.
| Key | Description |
|---|---|
| Space | Opens or closes the sheet. |
| Enter | Opens or closes the sheet. |
| Tab | Moves focus to the next focusable element. |
| Shift + Tab | Moves focus to the previous focusable element. |
| Esc | Closes the sheet and moves focus to the trigger. |