Components

A modal dialog for alerting users about important actions or decisions.

Installation

npm install @mijn-ui/react-alert-dialog

Usage

import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogTrigger,
} from "@mijn-ui/react-alert-dialog"
<AlertDialog>
  <AlertDialogTrigger>Open</AlertDialogTrigger>
  <AlertDialogContent>
    <AlertDialogHeader>
      <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
      <AlertDialogDescription>
        This action cannot be undone. This will permanently delete your account
        and remove your data from our servers.
      </AlertDialogDescription>
    </AlertDialogHeader>
    <AlertDialogFooter>
      <AlertDialogCancel>Cancel</AlertDialogCancel>
      <AlertDialogAction>Continue</AlertDialogAction>
    </AlertDialogFooter>
  </AlertDialogContent>
</AlertDialog>

API Reference

Built on Radix UI — all underlying primitive props are forwarded in addition to the props below.

PropTypeDefaultDescription
unstyledbooleanfalseOpt out of the default styles to fully customize the component.
classNamesobjectOverride classes per slot (see Style Slots below).
classNamestringAdditional classes for the root element.

AlertDialog Style Slots

Slot NameTargeted ComponentPurpose
baseAlertDialogStyles the root AlertDialog component.
triggerAlertDialogTriggerStyles the trigger element for the dialog.
overlayAlertDialogOverlayStyles the background overlay for the dialog.
contentWrapperAlertDialogContentStyles the wrapper around dialog content.
contentAlertDialogContentApplies styles to the dialog content element.
headerAlertDialogHeaderStyles the dialog header.
footerAlertDialogFooterStyles the dialog footer.
titleAlertDialogTitleStyles the title of the dialog.
descriptionAlertDialogDescriptionStyles the description text inside the dialog.
actionAlertDialogActionStyles the action buttons inside the dialog.
cancelAlertDialogCancelStyles the cancel button inside the dialog.