Alert Dialog

Demo

Props

PropTypeDescription
triggerReact.ReactNode (optional)The element that triggers the AlertDialog to open.
titlestring (optional)The title of the AlertDialog.
descriptionstring (optional)The description or main content of the AlertDialog.
cancelstring (optional)Text for the cancel button.
confirmstring (optional)Text for the confirm button.
onConfirm() => void (optional)Callback function that triggers when the confirm button is clicked.
classNames{ [key: string]: string } (optional)Custom class names for various AlertDialog components.

Styles

This component allows for custom styles via the classNames prop:

  • trigger: CSS class for styling the trigger element.
  • content: CSS class for styling the main content of the alert dialog.
  • header: CSS class for styling the header.
  • title: CSS class for styling the title.
  • description: CSS class for styling the description.
  • footer: CSS class for styling the footer.
  • cancel: CSS class for styling the cancel button.
  • confirm: CSS class for styling the confirm button.