dialog
pane/dialogFreeComponent
pane publishes no description for this item.
Install it
npx shadcn@latest add https://pane.theui.company/r/dialog.jsonSource
1"use client";23import { XIcon } from "lucide-react";4import { Dialog as DialogPrimitive } from "radix-ui";5import type * as React from "react";6import { Pane } from "@/components/ui/pane";7import { cn } from "@/lib/utils";89function Dialog({10 ...props11}: React.ComponentProps<typeof DialogPrimitive.Root>) {12 return <DialogPrimitive.Root data-slot="dialog" {...props} />;13}1415function DialogTrigger({16 ...props17}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {18 return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;19}2021function DialogClose({22 ...props23}: React.ComponentProps<typeof DialogPrimitive.Close>) {24 return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;25}2627function DialogOverlay({28 className,29 ...props30}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {31 return (32 <DialogPrimitive.Overlay33 data-slot="dialog-overlay"34 className={cn(35 "fixed inset-0 z-50 bg-black/30 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",36 className,37 )}38 {...props}39 />40 );41}4243function DialogContent({44 className,45 children,46 showCloseButton = true,47 ...props48}: React.ComponentProps<typeof DialogPrimitive.Content> & {49 showCloseButton?: boolean;50}) {51 return (52 <DialogPrimitive.Portal data-slot="dialog-portal">53 <DialogOverlay />54 {/* centered by flexbox rather than a -50% translate: a transformed55 ancestor is a containing block for the glass inside it, and the56 backdrop it samples ends up offset from where the pane is drawn */}57 <div className="pointer-events-none fixed inset-0 z-50 flex items-center justify-center p-4">58 <DialogPrimitive.Content59 data-slot="dialog-content"60 className={cn(61 "pointer-events-auto w-full max-w-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",62 className,63 )}64 {...props}65 >66 <Pane variant="regular" radius={28} className="grid gap-5 p-6">67 {children}68 {showCloseButton ? (69 <Pane70 variant="clear"71 interactive72 radius={999}73// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from pane
All 25 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| badgebadge | pane | Components | Free | 2 deps | |
| buttonbutton | pane | Components | Free | 2 deps | |
| cardcard | pane | Components | Free | no deps | |
| inputinput | pane | Components | Free | no deps | |
| panepane | pane | Components | Free | 1 dep | |
| sheetsheet | pane | Components | Free | 3 deps | |
| switchswitch | pane | Components | Free | 2 deps | |
| tabstabs | pane | Components | Free | 2 deps |
