dialog
obsidianui/dialogFreeComponent
obsidianui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by obsidianui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://obsidianui.dev/r/dialog.jsonSource
1"use client";23import * as React from "react";4import * as DialogPrimitive from "@radix-ui/react-dialog";5import { XIcon } from "lucide-react";67import { cn } from "@/lib/utils";89function Dialog({10 ...props11}: React.ComponentProps<typeof DialogPrimitive.Root>) {12 return <DialogPrimitive.Root data-slot="dialog" {...props} />;13}1415function DialogTrigger({16 ...props17}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {18 return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;19}2021function DialogPortal({22 ...props23}: React.ComponentProps<typeof DialogPrimitive.Portal>) {24 return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;25}2627function DialogClose({28 ...props29}: React.ComponentProps<typeof DialogPrimitive.Close>) {30 return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;31}3233function DialogOverlay({34 className,35 ...props36}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {37 return (38 <DialogPrimitive.Overlay39 data-slot="dialog-overlay"40 className={cn(41 "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",42 className43 )}44 {...props}45 />46 );47}4849function DialogContent({50 className,51 children,52 showCloseButton = true,53 ...props54}: React.ComponentProps<typeof DialogPrimitive.Content> & {55 showCloseButton?: boolean;56}) {57 return (58 <DialogPortal data-slot="dialog-portal">59 <DialogOverlay />60 <DialogPrimitive.Content61 data-slot="dialog-content"62 className={cn(63 "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 sm:max-w-lg",64 className65 )}66 {...props}67 >68 {children}69 {showCloseButton && (70 <DialogPrimitive.Close71 data-slot="dialog-close"72// … truncated
What it pulls in
npm packages
Files it writes
More from obsidianui
All 111 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-inputai-input | obsidianui | Components | Free | 2 deps | |
| alertalert | obsidianui | Components | Free | no deps | |
| animated-tab-baranimated-tab-bar | obsidianui | Components | Free | no deps | |
| apple-spotlightapple-spotlight | obsidianui | Components | Free | 2 deps | |
| avataravatar | obsidianui | Components | Free | 1 dep | |
| badgebadge | obsidianui | Components | Free | 1 dep | |
| breadcrumbbreadcrumb | obsidianui | Components | Free | 2 deps | |
| buttonbutton | obsidianui | Components | Free | 1 dep |
