Dialog
thegridcn/dialogFreeComponent
thegridcn publishes no description for this item.
Install it
npx shadcn@latest add https://thegridcn.com/r/dialog.jsonSource
1"use client"23import * as React from "react"4import * as DialogPrimitive from "@radix-ui/react-dialog"5import { XIcon } from "lucide-react"67import { 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 DialogPortal({22 ...props23}: React.ComponentProps<typeof DialogPrimitive.Portal>) {24 return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />25}2627function DialogClose({28 ...props29}: React.ComponentProps<typeof DialogPrimitive.Close>) {30 return <DialogPrimitive.Close data-slot="dialog-close" {...props} />31}3233function DialogOverlay({34 className,35 ...props36}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {37 return (38 <DialogPrimitive.Overlay39 data-slot="dialog-overlay"40 className={cn(41 "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",42 className43 )}44 {...props}45 />46 )47}4849function DialogContent({50 className,51 children,52 showCloseButton = true,53 ...props54}: React.ComponentProps<typeof DialogPrimitive.Content> & {55 showCloseButton?: boolean56}) {57 return (58 <DialogPortal data-slot="dialog-portal">59 <DialogOverlay />60 <DialogPrimitive.Content61 data-slot="dialog-content"62 className={cn(63 "bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",64 className65 )}66 {...props}67 >68 {children}69 {showCloseButton && (70 <DialogPrimitive.Close71 data-slot="dialog-close"72// … truncated
What it pulls in
npm packages
Files it writes
More from thegridcn
All 139 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | thegridcn | Components | Free | 2 deps | |
| Agent Avataragent-avatar | thegridcn | Components | Free | no deps | |
| Alertalert | thegridcn | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | thegridcn | Components | Free | 1 dep | |
| Announcement Barannouncement-bar | thegridcn | Components | Free | no deps | |
| Anomaly Banneranomaly-banner | thegridcn | Components | Free | no deps | |
| Arrival Panelarrival-panel | thegridcn | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | thegridcn | Components | Free | 1 dep |
