dialog
draco-china-github/dialogFreeComponent
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/draco-china/shadcn-pro/main/apps/docs/public/r/styles/radix-sera/dialog.jsonSource
1"use client"23import * as React from "react"4import { Dialog as DialogPrimitive } from "radix-ui"56import { cn } from "@/registry/radix-sera/lib/utils"7import { Button } from "@/registry/radix-sera/ui/button"8import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"910function Dialog({11 ...props12}: React.ComponentProps<typeof DialogPrimitive.Root>) {13 return <DialogPrimitive.Root data-slot="dialog" {...props} />14}1516function DialogTrigger({17 ...props18}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {19 return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />20}2122function DialogPortal({23 ...props24}: React.ComponentProps<typeof DialogPrimitive.Portal>) {25 return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />26}2728function DialogClose({29 ...props30}: React.ComponentProps<typeof DialogPrimitive.Close>) {31 return <DialogPrimitive.Close data-slot="dialog-close" {...props} />32}3334function DialogOverlay({35 className,36 ...props37}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {38 return (39 <DialogPrimitive.Overlay40 data-slot="dialog-overlay"41 className={cn(42 "fixed inset-0 isolate z-50 bg-black/20 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",43 className44 )}45 {...props}46 />47 )48}4950function DialogContent({51 className,52 children,53 showCloseButton = true,54 ...props55}: React.ComponentProps<typeof DialogPrimitive.Content> & {56 showCloseButton?: boolean57}) {58 return (59 <DialogPortal>60 <DialogOverlay />61 <DialogPrimitive.Content62 data-slot="dialog-content"63 className={cn(64 "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-none bg-popover p-6 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",65 className66 )}67 {...props}68 >69 {children}70 {showCloseButton && (71 <DialogPrimitive.Close data-slot="dialog-close" asChild>72 <Button73 variant="ghost"74 className="absolute top-5 right-5 bg-secondary"75 size="icon-sm"76 >77 <IconPlaceholder78 lucide="XIcon"79// … truncated
What it pulls in
Other registry items
Files it writes
More from shadcn/ui
All 201 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Free | no deps | |
| alertalert | shadcn/ui | Components | Free | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Free | no deps | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Free | no deps | |
| avataravatar | shadcn/ui | Components | Free | no deps | |
| badgebadge | shadcn/ui | Components | Free | no deps | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Free | no deps | |
| buttonbutton | shadcn/ui | Components | Free | no deps |
