Alert Dialog
roi-ui/alert-dialogFreeItem
A modal dialog that interrupts the user with important content.
Install it
npx shadcn@latest add https://roiui.com/r/alert-dialog.jsonSource
1"use client";23import { AlertDialog } from "@base-ui/react/alert-dialog";4import type React from "react";5import { cn } from "@/lib/utils";6import styles from "./alert-dialog.module.css";78function AlertDialogRoot({ ...props }: AlertDialog.Root.Props) {9 return <AlertDialog.Root {...props} />;10}1112function AlertDialogTrigger({ ...props }: AlertDialog.Trigger.Props) {13 return <AlertDialog.Trigger data-slot="alert-dialog-trigger" nativeButton {...props} />;14}1516const AlertDialogPortal = AlertDialog.Portal;1718function AlertDialogBackdrop({ className, ...props }: AlertDialog.Backdrop.Props) {19 return (20 <AlertDialog.Backdrop className={cn(styles.overlay, className)} data-slot="alert-dialog-backdrop" {...props} />21 );22}2324function AlertDialogPopup({ className, children, ...props }: AlertDialog.Popup.Props) {25 return (26 <AlertDialogPortal>27 <AlertDialog.Popup className={cn(styles.content, className)} data-slot="alert-dialog-popup" {...props}>28 {children}29 </AlertDialog.Popup>30 </AlertDialogPortal>31 );32}3334function AlertDialogContent({ className, children, ...props }: AlertDialog.Popup.Props) {35 return (36 <AlertDialogPortal>37 <AlertDialogBackdrop />38 <AlertDialog.Popup className={cn(styles.content, className)} data-slot="alert-dialog-popup" {...props}>39 {children}40 </AlertDialog.Popup>41 </AlertDialogPortal>42 );43}4445function AlertDialogTitle({ className, ...props }: AlertDialog.Title.Props) {46 return <AlertDialog.Title className={cn(styles.title, className)} data-slot="alert-dialog-title" {...props} />;47}4849function AlertDialogDescription({ className, ...props }: AlertDialog.Description.Props) {50 return (51 <AlertDialog.Description52 className={cn(styles.description, className)}53 data-slot="alert-dialog-description"54 {...props}55 />56 );57}5859function AlertDialogClose({ ...props }: AlertDialog.Close.Props) {60 return <AlertDialog.Close data-slot="alert-dialog-close" nativeButton {...props} />;61}6263const AlertDialogOverlay = AlertDialogBackdrop;6465function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">) {66 return <div className={cn(styles.header, className)} data-slot="alert-dialog-header" {...props} />;67}6869function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">) {70 return <div className={cn(styles.footer, className)} data-slot="alert-dialog-footer" {...props} />;71}7273export {74 AlertDialogRoot as AlertDialog,75 AlertDialogClose,76// … truncated
Files it writes
More from Roi UI
All 123 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | Roi UI | Other | Free | no deps · 2 files | |
| Accordion (Tailwind)accordion-tailwind | Roi UI | Other | Free | no deps | |
| AI Chatai-chat | Roi UI | Other | Free | no deps · 2 files | |
| AI Chat (Tailwind)ai-chat-tailwind | Roi UI | Other | Free | no deps | |
| Alertalert | Roi UI | Other | Free | 1 dep · 2 files | |
| Alert Dialog (Tailwind)alert-dialog-tailwind | Roi UI | Other | Free | no deps | |
| Alert (Tailwind)alert-tailwind | Roi UI | Other | Free | 1 dep | |
| Autocompleteautocomplete | Roi UI | Other | Free | no deps · 2 files |
