dialog
shadcn-solidjs/dialogFreeComponent
shadcn-solidjs publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn-solidjs on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://shadcn-solidjs.com/r/dialog.jsonSource
1import * as DialogPrimitive from "@kobalte/core/dialog";2import type { PolymorphicProps } from "@kobalte/core/polymorphic";34import { cn } from "~/lib/utils.ts";5import IconX from "~icons/lucide/x";6import type { Component, ComponentProps, JSX, ValidComponent } from "solid-js";78import { Show, splitProps } from "solid-js";9import { buttonVariants } from "./button.tsx";1011const Dialog = DialogPrimitive.Root;12const DialogPortal = DialogPrimitive.Portal;1314type DialogTriggerProps<T extends ValidComponent = "button"> =15 & DialogPrimitive.DialogTriggerProps<T>16 & { class?: string | undefined };1718const DialogTrigger = <T extends ValidComponent = "button">(19 props: PolymorphicProps<T, DialogTriggerProps<T>>,20) => {21 return (22 <DialogPrimitive.Trigger23 data-slot="dialog-trigger"24 {...(props as DialogTriggerProps)}25 />26 );27};2829type DialogCloseProps<T extends ValidComponent = "button"> =30 & DialogPrimitive.DialogCloseButtonProps<T>31 & { class?: string | undefined };3233const DialogClose = <T extends ValidComponent = "button">(34 props: PolymorphicProps<T, DialogCloseProps<T>>,35) => {36 return (37 <DialogPrimitive.CloseButton38 data-slot="dialog-close"39 {...(props as DialogCloseProps)}40 />41 );42};4344type DialogOverlayProps<T extends ValidComponent = "div"> =45 & DialogPrimitive.DialogOverlayProps<T>46 & { class?: string | undefined };4748const DialogOverlay = <T extends ValidComponent = "div">(49 props: PolymorphicProps<T, DialogOverlayProps<T>>,50) => {51 const [local, rest] = splitProps(props as DialogOverlayProps, ["class"]);52 return (53 <DialogPrimitive.Overlay54 data-slot="dialog-overlay"55 class={cn(56 "data-expanded:animate-in data-closed:animate-out data-closed:fade-out-0 data-expanded:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",57 local.class,58 )}59 {...rest}60 />61 );62};6364type DialogContentProps<T extends ValidComponent = "div"> =65 & DialogPrimitive.DialogContentProps<T>66 & {67 class?: string | undefined;68 children?: JSX.Element;69 showCloseButton?: boolean;70 };7172const DialogContent = <T extends ValidComponent = "div">(73 props: PolymorphicProps<T, DialogContentProps<T>>,74) => {75 const [local, rest] = splitProps(props as DialogContentProps, [76 "class",77 "children",78 "showCloseButton",79 ]);80 return (81 <DialogPortal>82 <DialogOverlay />83 <DialogPrimitive.Content84 data-slot="dialog-content"85// … truncated
What it pulls in
npm packages
Other registry items
More from shadcn-solidjs
All 85 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn-solidjs | Components | Free | 1 dep | |
| alertalert | shadcn-solidjs | Components | Free | 2 deps | |
| alert-dialogalert-dialog | shadcn-solidjs | Components | Free | 2 deps | |
| aspect-ratioaspect-ratio | shadcn-solidjs | Components | Free | no deps | |
| attachmentattachment | shadcn-solidjs | Components | Free | 2 deps | |
| avataravatar | shadcn-solidjs | Components | Free | 1 dep | |
| badgebadge | shadcn-solidjs | Components | Free | 2 deps | |
| breadcrumbbreadcrumb | shadcn-solidjs | Components | Free | 1 dep |
