alert-dialog
shadcn-solidjs/alert-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/alert-dialog.jsonSource
1import * as AlertDialogPrimitive from "@kobalte/core/alert-dialog";2import type { PolymorphicProps } from "@kobalte/core/polymorphic";34import { cn } from "~/lib/utils.ts";5import type { VariantProps } from "class-variance-authority";6import type { Component, ComponentProps, JSX, ValidComponent } from "solid-js";78import { splitProps } from "solid-js";9import { buttonVariants } from "./button.tsx";1011const AlertDialog = AlertDialogPrimitive.Root;12const AlertDialogPortal = AlertDialogPrimitive.Portal;1314type AlertDialogTriggerProps<T extends ValidComponent = "button"> =15 & AlertDialogPrimitive.AlertDialogTriggerProps<T>16 & { class?: string | undefined };1718const AlertDialogTrigger = <T extends ValidComponent = "button">(19 props: PolymorphicProps<T, AlertDialogTriggerProps<T>>,20) => {21 return (22 <AlertDialogPrimitive.Trigger23 data-slot="alert-dialog-trigger"24 {...(props as AlertDialogTriggerProps)}25 />26 );27};2829type AlertDialogOverlayProps<T extends ValidComponent = "div"> =30 & AlertDialogPrimitive.AlertDialogOverlayProps<T>31 & { class?: string | undefined };3233const AlertDialogOverlay = <T extends ValidComponent = "div">(34 props: PolymorphicProps<T, AlertDialogOverlayProps<T>>,35) => {36 const [local, others] = splitProps(props as AlertDialogOverlayProps, [37 "class",38 ]);39 return (40 <AlertDialogPrimitive.Overlay41 data-slot="alert-dialog-overlay"42 class={cn(43 "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 z-50",44 local.class,45 )}46 {...others}47 />48 );49};5051type AlertDialogContentProps<T extends ValidComponent = "div"> =52 & AlertDialogPrimitive.AlertDialogContentProps<T>53 & {54 class?: string | undefined;55 children?: JSX.Element;56 size?: "default" | "sm";57 };5859const AlertDialogContent = <T extends ValidComponent = "div">(60 props: PolymorphicProps<T, AlertDialogContentProps<T>>,61) => {62 const [local, others] = splitProps(props as AlertDialogContentProps, [63 "class",64 "children",65 "size",66 ]);67 return (68 <AlertDialogPortal>69 <AlertDialogOverlay />70 <AlertDialogPrimitive.Content71 data-slot="alert-dialog-content"72 data-size={local.size ?? "default"}73 class={cn(74// … 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 | |
| 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 | |
| bubblebubble | shadcn-solidjs | Components | Free | 2 deps |
