UI.MD

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.
openSheetboolean-Controlled open state. Pair with onOpenChange.
onOpenChangeSheet(open: boolean) => void-Called when the open state changes.
defaultOpenSheetbooleanfalseUncontrolled initial open state.
modalSheetbooleantrueWhen true, blocks interaction with the page behind the sheet.
renderSheetTrigger, SheetCloseReact.ReactElement-Replaces the default trigger or close button with your own element, e.g. render={<Button>Open</Button>}. Base UI merges props onto it.