Ballmac UI home

Sheet Dialog

A macOS sheet: a frosted panel that drops from the top edge of its window and dims only that window, with a default accent button, on Radix Dialog for focus trapping and Escape to cancel.

Keychain Access

Nothing saved yet.

Installation

$ pnpm dlx shadcn@latest add @ballmac/sheet-dialog

Usage

import { SheetDialog, SheetDialogTrigger, SheetDialogContent, SheetDialogHeader, SheetDialogTitle, SheetDialogDescription, SheetDialogFooter, SheetDialogClose, SheetDialogButton } from "@/components/ballmac/sheet-dialog"

The full example is in the Code tab above.

Examples

Form sheet in a window

Untitled

Not saved yet.

API reference

<SheetDialog>

PropTypeDefault
children*React.ReactNode—
open

Controlled open state.

boolean—
defaultOpen

Initial open state when uncontrolled.

booleanfalse
onOpenChange

Called when the sheet opens or closes.

(open: boolean) => void—
container

The window the sheet attaches to: an element or a ref to one (it should be `relative` and `overflow-hidden`). Without it the sheet attaches to the whole page.

Container—

<SheetDialogButton>

PropTypeDefault
primary

The default button: filled with the accent color, and the one Return activates inside a form.

booleanfalse
destructive

Destructive default buttons use red.

booleanfalse

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
EscapeCancels
FocusTrapped in the sheet and returned to the trigger on close
Screen readersNamed dialog with description
Reduced motionThe sheet fades in place

Use with AI

<SheetDialog container={windowRef}> with SheetDialogTrigger and SheetDialogContent (Header, Title, Description, Footer, Button primary). Give it the window element so it attaches there; without it it drops from the page. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Sheet Dialog (@ballmac/sheet-dialog) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Confirmations and short forms attached to a window
  • Mac-style apps and demos

Not for

  • General modals (dialog)
  • Side panels (sheet)

Registry JSON: https://ui.ballmac.com/r/sheet-dialog.json

Credits

Free to use in personal and commercial projects.

Registry
shadcn/utils