nessra uinessra ui

A window overlaid on the primary window.

Loading...
import { Button } from "@/components/ui/button"
import {
  Dialog,

Installation

pnpmnpmyarnbun
pnpm dlx shadcn@latest add https://nessra-ui.vercel.app/r/dialog.json

Usage

import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog"
<Dialog>
  <DialogTrigger>Open</DialogTrigger>
  <DialogContent>
    <DialogHeader>
      <DialogTitle>Are you sure?</DialogTitle>
      <DialogDescription>This action cannot be undone.</DialogDescription>
    </DialogHeader>
    <DialogFooter>
      <Button type="submit">Confirm</Button>
    </DialogFooter>
  </DialogContent>
</Dialog>

Examples

Basic Dialog

Loading...
import { Button } from "@/components/ui/button"
import {
  Dialog,

API Reference

Dialog

ComponentDescription
DialogThe root component
DialogTriggerThe button that opens the dialog
DialogContentThe dialog content container
DialogHeaderHeader section
DialogTitleThe dialog title
DialogDescriptionDescription text
DialogFooterFooter section for actions
DialogCloseClose button component

Dialog Props

PropTypeDefaultDescription
openboolean-The controlled open state
defaultOpenboolean-The default open state
onOpenChange(open: boolean) => void-Callback when open changes
modalbooleantrueWhether the dialog is modal

DialogContent Props

PropTypeDefaultDescription
showCloseButtonbooleantrueShow/hide the close button
onEscapeKeyDown(event: KeyboardEvent) => void-Called when escape key is pressed
onPointerDownOutside(event: PointerDownOutsideEvent) => void-Called when clicking outside