Dialog
scificn/dialogFreeComponent
Modal dialog with void overlay and corner notch content panel.
Live preview
live · rendered by the registry
Rendered by scificn on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.scificn.dev/r/dialog.jsonSource
1'use client'23import * as React from 'react'4import * as DialogPrimitive from '@radix-ui/react-dialog'5import { cn } from '@/lib/utils'67const Dialog = DialogPrimitive.Root8const DialogTrigger = DialogPrimitive.Trigger9const DialogPortal = DialogPrimitive.Portal10const DialogClose = DialogPrimitive.Close1112/* ── Overlay ── */13const DialogOverlay = React.forwardRef<14 React.ElementRef<typeof DialogPrimitive.Overlay>,15 React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>16>(({ className, ...props }, ref) => (17 <DialogPrimitive.Overlay18 ref={ref}19 className={cn(20 'fixed inset-0 z-50',21 'data-[state=open]:animate-in data-[state=closed]:animate-out',22 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',23 className24 )}25 style={{ background: 'rgba(7, 5, 15, 0.88)' }}26 {...props}27 />28))29DialogOverlay.displayName = DialogPrimitive.Overlay.displayName3031/* ── Content ── */32const DialogContent = React.forwardRef<33 React.ElementRef<typeof DialogPrimitive.Content>,34 React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>35>(({ className, children, ...props }, ref) => (36 <DialogPortal>37 <DialogOverlay />38 <DialogPrimitive.Content39 ref={ref}40 className={cn(41 'fixed left-[50%] top-[50%] z-50',42 'translate-x-[-50%] translate-y-[-50%]',43 'w-full max-w-lg',44 'border border-[var(--border)]',45 'bg-[var(--surface-raised)]',46 'rounded-none',47 'shadow-[var(--glow-green)]',48 'focus:outline-none',49 'data-[state=open]:animate-in data-[state=closed]:animate-out',50 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',51 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',52 className53 )}54 style={{ clipPath: 'var(--clip-corner-md)' }}55 {...props}56 >57 {children}58 <DialogPrimitive.Close59 style={{60 position: 'absolute',61 right: '0.75rem',62 top: '0.75rem',63 background: 'transparent',64 border: 'none',65 color: 'var(--text-muted)',66 cursor: 'pointer',67 fontSize: '0.8rem',68 padding: '2px 4px',69 lineHeight: 1,70 transition: 'color 0.15s',71 fontFamily: 'var(--font-mono)',72 }}73 onMouseEnter={(e) => (e.currentTarget.style.color = 'var(--color-red)')}74// … truncated
What it pulls in
npm packages
More from scificn
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alertalert | scificn | Components | Free | 1 dep | |
| Badgebadge | scificn | Components | Free | 1 dep | |
| Bar Chartbar-chart | scificn | Components | Free | no deps | |
| Breadcrumbbreadcrumb | scificn | Components | Free | no deps | |
| Buttonbutton | scificn | Components | Free | 2 deps | |
| Cardcard | scificn | Components | Free | no deps | |
| Checkboxcheckbox | scificn | Components | Free | 1 dep | |
| Gridgrid | scificn | Components | Free | no deps |
