Glass Alert Dialog
washiveil/glass-alert-dialogFreeComponent
Confirmation dialog on strong glass, built on Radix AlertDialog.
Install it
npx shadcn@latest add https://washiveil.alexchih.com/r/glass-alert-dialog.jsonSource
1'use client'23import * as React from 'react'4import { AlertDialog as AlertDialogPrimitive } from 'radix-ui'56import { cn } from '@/lib/utils'78const GlassAlertDialog = AlertDialogPrimitive.Root910const GlassAlertDialogTrigger = AlertDialogPrimitive.Trigger1112const GlassAlertDialogPortal = AlertDialogPrimitive.Portal1314const GlassAlertDialogOverlay = React.forwardRef<15 React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,16 React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>17>(({ className, ...props }, ref) => (18 <AlertDialogPrimitive.Overlay19 ref={ref}20 className={cn(21 'fixed inset-0 z-50 bg-deep/20 backdrop-blur-sm dark:bg-black/40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',22 className,23 )}24 {...props}25 />26))27GlassAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName2829const GlassAlertDialogContent = React.forwardRef<30 React.ComponentRef<typeof AlertDialogPrimitive.Content>,31 React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>32>(({ className, ...props }, ref) => (33 <GlassAlertDialogPortal>34 <GlassAlertDialogOverlay />35 <AlertDialogPrimitive.Content36 ref={ref}37 className={cn(38 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-3xl border border-glass-edge bg-glass-stronger p-6 backdrop-blur-2xl backdrop-saturate-150 shadow-[0_16px_48px_rgba(28,25,20,0.12)] duration-200 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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',39 className,40 )}41 {...props}42 />43 </GlassAlertDialogPortal>44))45GlassAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName4647function GlassAlertDialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {48 return <div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />49}50GlassAlertDialogHeader.displayName = 'GlassAlertDialogHeader'5152function GlassAlertDialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {53// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from washiveil
All 58 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Ambient Fieldambient-field | washiveil | Components | Free | no deps | |
| Chipchip | washiveil | Components | Free | 1 dep | |
| Code Badgecode-badge | washiveil | Components | Free | no deps | |
| Glass Accordionglass-accordion | washiveil | Components | Free | 2 deps | |
| Glass Alertglass-alert | washiveil | Components | Free | 1 dep | |
| Glass Aspect Ratioglass-aspect-ratio | washiveil | Components | Free | 1 dep | |
| Glass Avatarglass-avatar | washiveil | Components | Free | 1 dep | |
| Glass Breadcrumbglass-breadcrumb | washiveil | Components | Free | 2 deps |
