docs/components/sheet
Sections
Components
Utilities
Forms
Hooks
Copy Markdown
Content that slides in from the screen edge.
PreviewCode
Open
CLIManual
pnpmbunnpmyarn
pnpm dlx shadcn@latest add @shark/sheet
Sheet
├── SheetTrigger
└── SheetContent
├── SheetHeader
│ ├── SheetTitle
│ └── SheetDescription
├── SheetBody
└── SheetFooter
└── SheetClose
import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
SheetTrigger
} from "@/components/ui/sheet";
<Sheet>
<SheetTrigger>Open</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Sheet Title</SheetTitle>
<SheetDescription>Sheet Description</SheetDescription>
</SheetHeader>
</SheetContent>
</Sheet>
Use open and onOpenChange on the root to control the sheet state.
PreviewCode
Open ControlledOpen Uncontrolled
Control which side the sheet slides in from using the side prop.
PreviewCode
RightLeftBottom
Use the variant="inset" prop to add padding. The sheet appears as a floating card.
PreviewCode
Open
Use SheetBody to make the content area scrollable while keeping header and footer fixed.
PreviewCode
Open
Use the showCloseButton={false} prop to hide the close button in the top right corner.
PreviewCode
Open
Use closeOnInteractOutside and closeOnEscape props to prevent closing on outside click and escape.
PreviewCode
No close on outside clickNo close on Escape
Use modal={false} to allow interaction with elements outside the sheet.
PreviewCode
Open
Use [--space:--spacing("value")] on SheetContent to adjust internal padding.
Default spacing is --spacing(6).
PreviewCode
Open
You can use breakpoint utilities to change the internal spacing at different screen sizes.
md:[--space:--spacing(6)] lg:[--space:--spacing(8)]
Root component. Uses Ark UI Dialog. Controls open state and slide direction.
| Prop | Type | Default |
|---|---|---|
open | boolean | - |
defaultOpen | boolean | false |
onOpenChange | ({ open }: OpenChangeDetails) => void | - |
modal | boolean | true |
closeOnEscape | boolean | true |
closeOnInteractOutside | boolean | true |
initialFocusEl | () => MaybeElement | - |
finalFocusEl | () => MaybeElement | - |
onEscapeKeyDown | (event: KeyboardEvent) => void | - |
onInteractOutside | (event: InteractOutsideEvent) => void | - |
className | string | - |
Opens the sheet on click. Use asChild for custom triggers.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | false |
className | string | - |
Holds the sheet panel. Slides in from the configured edge.
| Prop | Type | Default |
|---|---|---|
side | `"right" | "left" |
variant | `"default" | "inset"` |
showCloseButton | boolean | true |
className | string | - |
| Attribute | Default |
|---|---|
--space | --spacing(6) |
Header area for title and description.
| Prop | Type | Default |
|---|---|---|
title | string | - |
description | string | - |
className | string | - |
Scrollable body content. Uses ScrollArea for overflow.
| Prop | Type | Default |
|---|---|---|
scrollFade | boolean | false |
className | string | - |
Footer area for action buttons.
| Prop | Type | Default |
|---|---|---|
className | string | - |
Accessible title. Announced to screen readers.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | false |
className | string | - |
Accessible description. Announced to screen readers.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | false |
className | string | - |
Closes the sheet on click.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | false |
className | string | - |
Dimmed overlay behind the sheet.
| Prop | Type | Default |
|---|---|---|
className | string | - |
Positioning wrapper for sheet content. Used internally; expose for custom layouts.
| Prop | Type | Default |
|---|---|---|
side | `"right" | "left" |
variant | `"default" | "inset"` |
className | string | - |
For a complete list of props, see the Ark UI documentation.
[
Previous page
Separator ](/docs/components/separator)[
Next page
Sidebar ](/docs/components/sidebar)
On This Page
InstallationAnatomyUsageControlledSidesExamplesInset VariantScrollableNo Close ButtonClose behaviorNon-ModalCustom spacingAPI ReferenceSheetSheetTriggerSheetContentSheetHeaderSheetBodySheetFooterSheetTitleSheetDescriptionSheetCloseSheetOverlaySheetPositioner