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

With Sections

SheetHeader and SheetFooter frame the body; showCancelButton adds a ghost Cancel beside the primary action.

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.