dialog
gmhlab/dialogFreeComponent
gmhlab publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/gmhlab/monorepo/main/packages/ui/public/r/dialog.jsonSource
1import * as React from "react"2import { XIcon } from "lucide-react"3import { Dialog as DialogPrimitive } from "radix-ui"45import { cn } from "@/lib/utils"6import { Button } from "@/components/ui/button"78function Dialog({9 ...props10}: React.ComponentProps<typeof DialogPrimitive.Root>) {11 return <DialogPrimitive.Root data-slot="dialog" {...props} />12}1314function DialogTrigger({15 ...props16}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {17 return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />18}1920function DialogPortal({21 ...props22}: React.ComponentProps<typeof DialogPrimitive.Portal>) {23 return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />24}2526function DialogClose({27 ...props28}: React.ComponentProps<typeof DialogPrimitive.Close>) {29 return <DialogPrimitive.Close data-slot="dialog-close" {...props} />30}3132function DialogOverlay({33 className,34 ...props35}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {36 return (37 <DialogPrimitive.Overlay38 data-slot="dialog-overlay"39 className={cn(40 "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",41 className42 )}43 {...props}44 />45 )46}4748function DialogContent({49 className,50 children,51 showCloseButton = true,52 ...props53}: React.ComponentProps<typeof DialogPrimitive.Content> & {54 showCloseButton?: boolean55}) {56 return (57 <DialogPortal data-slot="dialog-portal">58 <DialogOverlay />59 <DialogPrimitive.Content60 data-slot="dialog-content"61 className={cn(62 "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",63 className64 )}65 {...props}66 >67 {children}68 {showCloseButton && (69 <DialogPrimitive.Close70 data-slot="dialog-close"71// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from gmhlab
All 64 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | gmhlab | Components | Free | 2 deps | |
| alertalert | gmhlab | Components | Free | 1 dep | |
| alert-dialogalert-dialog | gmhlab | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | gmhlab | Components | Free | 1 dep | |
| avataravatar | gmhlab | Components | Free | 1 dep | |
| badgebadge | gmhlab | Components | Free | 2 deps | |
| breadcrumbbreadcrumb | gmhlab | Components | Free | 2 deps | |
| buttonbutton | gmhlab | Components | Free | 2 deps |
