dialog
shipbase-ui/dialogFreeComponent
shipbase/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/shipbase/ui/next/apps/www/public/r/react/dialog.jsonSource
1"use client"23import * as React from "react"45import { Dialog as DialogPrimitive, dialogAnatomy } from "@ark-ui/react/dialog"6import { type HTMLArkProps, ark } from "@ark-ui/react/factory"7import { Portal } from "@ark-ui/react/portal"8import { XIcon } from "lucide-react"910import { cn } from "@/lib/utils"1112const parts = dialogAnatomy.extendWith("header").build()1314const Dialog = DialogPrimitive.Root1516const DialogBackdrop = React.forwardRef<17 React.ElementRef<typeof DialogPrimitive.Backdrop>,18 DialogPrimitive.BackdropProps19>(({ className, ...props }, ref) => (20 <DialogPrimitive.Backdrop21 ref={ref}22 className={cn(23 "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[--z-index] bg-black/80 data-[state=closed]:animate-out data-[state=open]:animate-in",24 className25 )}26 {...props}27 />28))29DialogBackdrop.displayName = "DialogBackdrop"3031const DialogCloseTrigger = DialogPrimitive.CloseTrigger3233const DialogContent = React.forwardRef<34 React.ElementRef<typeof DialogPrimitive.Content>,35 DialogPrimitive.ContentProps36>(({ className, children, ...props }, ref) => (37 <Portal>38 <DialogBackdrop />39 <DialogPrimitive.Positioner>40 <DialogPrimitive.Content41 ref={ref}42 className={cn(43 "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 -translate-x-1/2 -translate-y-1/2 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-[--z-index] grid max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] gap-4 overflow-y-auto rounded-xl border bg-background p-6 shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-100",44 className45 )}46 {...props}47 >48 {children}49 <DialogPrimitive.CloseTrigger className="group absolute top-3 right-3 flex size-7 items-center justify-center rounded outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none">50 <XIcon className="size-4 opacity-60 transition-opacity group-hover:opacity-100" />51 <span className="sr-only">Close</span>52 </DialogPrimitive.CloseTrigger>53 </DialogPrimitive.Content>54 </DialogPrimitive.Positioner>55 </Portal>56))57DialogContent.displayName = "DialogContent"5859const DialogContext = DialogPrimitive.Context6061const DialogDescription = React.forwardRef<62 React.ElementRef<typeof DialogPrimitive.Description>,63// … truncated
What it pulls in
npm packages
Files it writes
More from shipbase/ui
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shipbase/ui | Components | Free | 2 deps | |
| avataravatar | shipbase/ui | Components | Free | 1 dep | |
| badgebadge | shipbase/ui | Components | Free | 2 deps | |
| buttonbutton | shipbase/ui | Components | Free | 2 deps | |
| cardcard | shipbase/ui | Components | Free | 1 dep | |
| checkboxcheckbox | shipbase/ui | Components | Free | 2 deps | |
| collapsiblecollapsible | shipbase/ui | Components | Free | 1 dep | |
| comboboxcombobox | shipbase/ui | Components | Free | 2 deps |
