Start here
  • InstallationAdd Nelumbo to a shadcn project
  • ThemingBrand accent, neutrals, dynamic color
  • Biology componentsSequences, maps, plates and trees
  • katalyx.bio

    Alert Dialog

    A modal that interrupts to confirm something that matters. Unlike a dialog it can't be dismissed by clicking outside: the person has to choose. Focus lands on Cancel, so a stray Enter is safe.

    Install

    npx shadcn@latest add @nelumbo/alert-dialog

    Destructive

    variant='destructive' on the root makes the action a destructive button and tints the icon tile. The icon centers the header; the actions stay right-aligned (stacked full width on phones).

    Nothing chosen yet.

    With an icon

    Without variant the tile is a neutral tonal one.

    Plain

    Exactly shadcn's anatomy: left-aligned text, no icon.

    Usage

    import {  AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader,  AlertDialogFooter, AlertDialogTitle, AlertDialogDescription,  AlertDialogAction, AlertDialogCancel,} from "@/components/ui/alert-dialog"​<AlertDialog variant="destructive">  <AlertDialogTrigger asChild><Button variant="outline">Delete</Button></AlertDialogTrigger>  <AlertDialogContent>    <AlertDialogHeader icon="delete">      <AlertDialogTitle>Delete this project?</AlertDialogTitle>      <AlertDialogDescription>This can't be undone.</AlertDialogDescription>    </AlertDialogHeader>    <AlertDialogFooter>      <AlertDialogCancel>Cancel</AlertDialogCancel>      <AlertDialogAction>Delete</AlertDialogAction>    </AlertDialogFooter>  </AlertDialogContent></AlertDialog>

    Props

    Other props go to Radix AlertDialog (open, onOpenChange, defaultOpen) and its parts.

    PropTypeDefaultNotes
    AlertDialog variant"default" | "destructive""default"Destructive tints the icon tile and the action
    AlertDialogHeader iconIconNamenoneMaterial Symbol in a tonal tile; centers the header
    AlertDialogContent size"sm" | "default""default"Max width 22rem or 26rem
    AlertDialogAction variantButton variantper dialogAlso size and shape
    AlertDialogCancel variantButton variant"ghost"Also size and shape