dialog
ora-ui/dialogFreeComponent
ora-ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by ora-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ora-ui.com/r/dialog.jsonSource
1'use client';23import * as React from 'react';4import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';56import { cn } from '@/registry/lib/utils';7import { Button } from '@/registry/ui/button';8import { XIcon } from '@phosphor-icons/react';910function Dialog({ ...props }: DialogPrimitive.Root.Props) {11 return <DialogPrimitive.Root data-slot="dialog" {...props} />;12}1314function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {15 return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;16}1718function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {19 return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;20}2122function DialogClose({ ...props }: DialogPrimitive.Close.Props) {23 return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;24}2526function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props) {27 return (28 <DialogPrimitive.Backdrop29 data-slot="dialog-overlay"30 className={cn(31 'fixed inset-0 isolate z-50 bg-black/80 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',32 className33 )}34 {...props}35 />36 );37}3839function DialogContent({40 className,41 children,42 showCloseButton = true,43 ...props44}: DialogPrimitive.Popup.Props & {45 showCloseButton?: boolean;46}) {47 return (48 <DialogPortal>49 <DialogOverlay />50 <DialogPrimitive.Popup51 data-slot="dialog-content"52 className={cn(53 '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 overflow-hidden rounded-lg bg-surface text-sm ring-1 ring-primary/15 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',54 className55 )}56 {...props}57 >58 {children}59 {showCloseButton && (60 <DialogPrimitive.Close61 data-slot="dialog-close"62 render={<Button variant="ghost" className="absolute top-4 right-4" size="icon-sm" />}63 >64 <XIcon />65 <span className="sr-only">Close</span>66 </DialogPrimitive.Close>67 )}68 </DialogPrimitive.Popup>69 </DialogPortal>70 );71}7273function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {74 return (75 <div76 data-slot="dialog-header"77// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from ora-ui
All 31 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | ora-ui | Components | Free | 2 deps | |
| alert-dialogalert-dialog | ora-ui | Components | Free | 1 dep | |
| avataravatar | ora-ui | Components | Free | 1 dep | |
| avatar-groupavatar-group | ora-ui | Components | Free | no deps | |
| badgebadge | ora-ui | Components | Free | 2 deps | |
| buttonbutton | ora-ui | Components | Free | 2 deps | |
| button-groupbutton-group | ora-ui | Components | Free | 2 deps | |
| checkboxcheckbox | ora-ui | Components | Free | 3 deps |
