Pixelact Alert Dialog
pixelact-ui/alert-dialogFreeComponent
A simple alert dialog component.
Live preview
live · rendered by the registry
Rendered by Pixelact UI on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://pixelactui.com/r/alert-dialog.jsonSource
1import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";2import { type VariantProps, cva } from "class-variance-authority";3import { cn } from "@/lib/utils";4import {5 AlertDialog as ShadcnAlertDialog,6 AlertDialogTrigger as ShadcnAlertDialogTrigger,7 AlertDialogContent as ShadcnAlertDialogContent,8 AlertDialogDescription as ShadcnAlertDialogDescription,9 AlertDialogFooter as ShadcnAlertDialogFooter,10 AlertDialogHeader as ShadcnAlertDialogHeader,11 AlertDialogOverlay as ShadcnAlertDialogOverlay,12 AlertDialogPortal as ShadcnAlertDialogPortal,13 AlertDialogTitle as ShadcnAlertDialogTitle,14} from "@/components/ui/alert-dialog";1516import "@/components/ui/pixelact-ui/styles/styles.css";1718export const alertDialogVariants = cva("", {19 variants: {20 font: {21 normal: "",22 pixel: "pixel-font",23 },24 },25 defaultVariants: {26 font: "pixel",27 },28});2930export interface AlertDialogProps31 extends React.ComponentProps<typeof AlertDialogPrimitive.Root>,32 VariantProps<typeof alertDialogVariants> {}3334function AlertDialog({ ...props }: AlertDialogProps) {35 return <ShadcnAlertDialog {...props} />;36}3738function AlertDialogTrigger({39 className,40 asChild = true,41 ...props42}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {43 return (44 <ShadcnAlertDialogTrigger45 className={cn(className)}46 asChild={asChild}47 {...props}48 />49 );50}5152function AlertDialogPortal({53 ...props54}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {55 return <ShadcnAlertDialogPortal {...props} />;56}5758function AlertDialogOverlay({59 className,60 ...props61}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {62 return <ShadcnAlertDialogOverlay className={cn(className)} {...props} />;63}6465interface AlertDialogContentProps66 extends React.ComponentProps<typeof AlertDialogPrimitive.Content>,67 VariantProps<typeof alertDialogVariants> {}6869function AlertDialogContent({70 className,71 children,72 font,73 ...props74}: AlertDialogContentProps) {75 return (76 <AlertDialogPortal>77 <AlertDialogOverlay />78 <>79 <ShadcnAlertDialogContent80 className={cn(81 "rounded-none shadow-(--pixel-box-shadow) box-shadow-margin",82 alertDialogVariants({ font }),83 className84 )}85 {...props}86 >87 {children}88 </ShadcnAlertDialogContent>89 </>90 </AlertDialogPortal>91 );92}9394function AlertDialogHeader({95 className,96 ...props97// … truncated
What it pulls in
Other registry items
Files it writes
More from Pixelact UI
All 28 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Pixelact Accordionaccordion | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Alertalert | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Avataravatar | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Badgebadge | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Breadcrumbbreadcrumb | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Buttonbutton | Pixelact UI | Components | Free | no deps · 3 files | |
| Pixelact Calendarcalendar | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Cardcard | Pixelact UI | Components | Free | no deps · 2 files |
