Back to Compositions

AlertDialog

Feedback

Confirmation dialog for destructive actions

Composed from
ModalTextButton
Example
Delete itemThis action cannot be undone. The item will be permanently removed.DeleteCancel
Usage
import { AlertDialog, Button } from '@/components/polaris';

function Example() {
    return (
        <AlertDialog
            trigger={<Button tone="critical">Delete product</Button>}
            heading="Delete this product?"
            onConfirm={() => console.log('deleted')}
        >
            This will permanently delete "Blue T-Shirt" and remove it from all
            collections. This action cannot be undone.
        </AlertDialog>
    );
}