Vicinae

Alert

A confirmation dialog for destructive or important actions. The user must explicitly confirm or cancel.

confirmAlert

import { confirmAlert, Alert } from "@vicinae/api";

const confirmed = await confirmAlert({
  title: "Delete Apple?",
  message: "This cannot be undone.",
  primaryAction: {
    title: "Delete",
    style: Alert.ActionStyle.Destructive,
  },
});

if (confirmed) {
  // delete the fruit
}

Action Styles

StyleDescription
Alert.ActionStyle.DefaultStandard confirm button
Alert.ActionStyle.DestructiveRed, used for irreversible actions
Alert.ActionStyle.CancelDismisses the dialog