Sheet

A full-screen surface inset from every edge, with the page blurred behind it.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/sheet.json

Usage

import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription } from "@/components/ui/sheet"

Examples

Default

A focused surface inset from every edge with the page blurred behind it. SheetContent is a plain flex column, so centring the content is a class you pass, not a default.

Detail View

A canvas beside a details rail: the layout that earns a full-screen surface. gap-0 lets the dividers own their spacing, and every band around one is the sheet's own 24px padding.

API Reference

PropTypeDefaultDescription
showCloseButtonSheetContentbooleantrueShows the X close button in the top-right corner.
showCancelButtonSheetFooterbooleanfalseRenders a ghost Cancel button that closes the sheet.
openSheetbooleanNoneControlled open state. Pair with onOpenChange.
onOpenChangeSheet(open: boolean) => voidNoneCalled when the open state changes.
defaultOpenSheetbooleanfalseUncontrolled initial open state.
modalSheetbooleantrueWhen true, blocks interaction with the page behind the sheet.
renderSheetTrigger, SheetCloseReact.ReactElementNoneReplaces the default trigger or close button with your own element, e.g. render={<Button>Open</Button>}. Base UI merges props onto it.
showCloseButtonSheetContentboolean = trueShows the X close button in the top-right corner.
showCancelButtonSheetFooterboolean = falseRenders a ghost Cancel button that closes the sheet.
openSheetbooleanControlled open state. Pair with onOpenChange.
onOpenChangeSheet(open: boolean) => voidCalled when the open state changes.
defaultOpenSheetboolean = falseUncontrolled initial open state.
modalSheetboolean = trueWhen true, blocks interaction with the page behind the sheet.
renderSheetTrigger, SheetCloseReact.ReactElementReplaces the default trigger or close button with your own element, e.g. render={<Button>Open</Button>}. Base UI merges props onto it.