Volt UI
Components

Alert Dialog

An alert dialog is a modal surface that appears above the main interface to capture the user’s attention

Basic Usage

Here is example of an alert dialog.

import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, Button } from "@epilot/volt-ui"

<AlertDialog>
  <AlertDialogTrigger asChild>
    <Button destructive>Delete Account</Button>
  </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 variant="primary">Confirm</AlertDialogAction>
    </AlertDialogFooter>
  </AlertDialogContent>
</AlertDialog>

API Reference

AlertDialog

Root that controls open state.

PropTypeDefaultDescription
openboolean-Controlled open state.
defaultOpenboolean-Uncontrolled initial open state.
onOpenChange(open: boolean) => void-Called when the open state changes.

AlertDialogTrigger

Element that opens the dialog.

PropTypeDefaultDescription
asChildbooleanfalseRender the trigger as its child (e.g., custom button).

AlertDialogPortal

Renders content in a portal.

PropTypeDefaultDescription
forceMountbooleanfalseKeep content mounted when closed.
containerHTMLElement | nullnullDOM node to render the portal into.

AlertDialogOverlay

Backdrop overlay behind the dialog.

PropTypeDefaultDescription
classNamestring-Additional classes for the overlay.

AlertDialogContent

Dialog surface.

PropTypeDefaultDescription
classNamestring-Additional classes for the content.

AlertDialogHeader

Wrapper for title/description.

PropTypeDefaultDescription
classNamestring-Additional classes for the header.

AlertDialogTitle

Required heading.

PropTypeDefaultDescription
classNamestring-Additional classes for the title.

AlertDialogDescription

Supporting text.

PropTypeDefaultDescription
classNamestring-Additional classes for the description.

AlertDialogFooter

Container for actions.

PropTypeDefaultDescription
classNamestring-Additional classes for the footer.

AlertDialogAction

Primary/confirm action.

PropTypeDefaultDescription
variant"primary" | "secondary" | "tertiary""primary"Button style for the confirm action.
destructivebooleanfalseDestructive styling
sizeSame as Button componentButton size for the confirm action.
classNamestring-Additional classes for the button.

AlertDialogCancel

Secondary/cancel action.

PropTypeDefaultDescription
variant"primary" | "secondary" | "tertiary" | "destructive""secondary"Button style for the cancel action.
sizeSame as Button componentButton size for the cancel action.
classNamestring-Additional classes for the button.