BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/amarjay-ui/dialog

dialog

amarjay-ui/dialog
FreeComponent

Accessible modal dialog component.

Live preview

live · rendered by the registry
Rendered by amarjay-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://ui.amarjay.com/r/dialog.json

Source

src/components/ui/dialog.tsxui.amarjay.com/r/dialog.json
1"use client"
2
3import * as React from "react"
4import { Dialog as DialogPrimitive } from "radix-ui"
5
6import { cn } from "@/lib/utils"
7import { Button } from "@/components/ui/button"
8import { XIcon } from "lucide-react"
9
10function Dialog({
11 ...props
12}: React.ComponentProps<typeof DialogPrimitive.Root>) {
13 return <DialogPrimitive.Root data-slot="dialog" {...props} />
14}
15
16function DialogTrigger({
17 ...props
18}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
19 return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
20}
21
22function DialogPortal({
23 ...props
24}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
25 return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
26}
27
28function DialogClose({
29 ...props
30}: React.ComponentProps<typeof DialogPrimitive.Close>) {
31 return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
32}
33
34function DialogOverlay({
35 className,
36 ...props
37}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
38 return (
39 <DialogPrimitive.Overlay
40 data-slot="dialog-overlay"
41 className={cn(
42 "fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
43 className
44 )}
45 {...props}
46 />
47 )
48}
49
50function DialogContent({
51 className,
52 children,
53 showCloseButton = true,
54 ...props
55}: React.ComponentProps<typeof DialogPrimitive.Content> & {
56 showCloseButton?: boolean
57}) {
58 return (
59 <DialogPortal>
60 <DialogOverlay />
61 <DialogPrimitive.Content
62 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-4 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm 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 className
66 )}
67 {...props}
68 >
69 {children}
70 {showCloseButton && (
71 <DialogPrimitive.Close data-slot="dialog-close" asChild>
72 <Button
73 variant="ghost"
74 className="absolute top-2 right-2"
75 size="icon-sm"
76 >
77 <XIcon
78 />
79 <span className="sr-only">Close</span>
80 </Button>
81 </DialogPrimitive.Close>
82// … truncated

What it pulls in

npm packages

  • lucide-react
  • radix-ui

Other registry items

  • button
  • utils

Files it writes

  • src/components/ui/dialog.tsx

Facts

Registry
amarjay-ui
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-10
Last confirmed
today

Go to the source

Docs on amarjay-ui ui.amarjay.com amar-jay/ui on GitHub Raw registry item This item as JSON

More from amarjay-ui

All 18 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
alertalertamarjay-uiComponentsFree1 dep
avataravataramarjay-uiComponentsFree1 dep
badgebadgeamarjay-uiComponentsFree2 deps
buttonbuttonamarjay-uiComponentsFree2 deps
cardcardamarjay-uiComponentsFreeno deps
chartchartamarjay-uiComponentsFree1 dep
context-menucontext-menuamarjay-uiComponentsFree2 deps
dropdown-menudropdown-menuamarjay-uiComponentsFree2 deps
BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex