Skip to Content
zjkm-ui
Components

Sheet Dialog

A dialog that slides up from the bottom.

Share this page

Anyone with the link can view it.

Props
<SheetDialog open={open} title="Share this page" onClose={close}>
  <ShareOptions />
</SheetDialog>

Installation

npx shadcn@latest add https://ui.zjkm.tech/r/sheet-dialog.json
import { 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

PropTypeDefaultDescription
openbooleanShows the sheet.
titlestringThe heading and accessible name.
childrenReactNodeThe content.
onClose() => voidCalled by the close button, Escape and the backdrop.

With reduced motion, the sheet appears without sliding up.

On this page