Components
Sheet Dialog
A dialog that slides up from the bottom.
<SheetDialog open={open} title="Share this page" onClose={close}>
<ShareOptions />
</SheetDialog>Installation
npx shadcn@latest add https://ui.zjkm.tech/r/sheet-dialog.jsonimport { SheetDialog } from "@/components/sheet-dialog"Using JavaScript? Set tsx: false in components.json and the CLI converts it.
New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.
Usage
A modal that slides up from the bottom of the screen, like a mobile sheet, with a grip at the top. It's a native modal <dialog>: focus moves in and stays there, Escape closes it, and the page behind can't be reached. Clicking the backdrop closes it too.
import { SheetDialog } from "@/components/sheet-dialog";
export function ShareSheet() {
const [open, setOpen] = useState(false);
return (
<>
<button onClick={() => setOpen(true)}>Share</button>
<SheetDialog open={open} title="Share this page" onClose={() => setOpen(false)}>
<ShareOptions />
</SheetDialog>
</>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | Shows the sheet. | |
title | string | The heading and accessible name. | |
children | ReactNode | The content. | |
onClose | () => void | Called by the close button, Escape and the backdrop. |
With reduced motion, the sheet appears without sliding up.