preskok/ui

Modal dialog with header, body, and footer composition.

Installation

pnpm dlx @preskok-org/ui@latest add dialog

Usage

import {
  Dialog,
  DialogBody,
  DialogFooter,
  DialogHeader,
  DialogTrigger,
} from "@/registry/preskok/ui/preskok-ui/dialog"
 
export function Example() {
  return (
    <DialogTrigger>
      <button>Open dialog</button>
      <Dialog>
        <DialogHeader title="Dialog title" description="Optional description" />
        <DialogBody>Content</DialogBody>
        <DialogFooter>
          <button slot="close">Close</button>
        </DialogFooter>
      </Dialog>
    </DialogTrigger>
  )
}

Components

  • Dialog: root
  • DialogTrigger, DialogHeader, DialogBody, DialogFooter