AlertDialog
A confirmation dialog with cancel and action buttons.
Import
import { AlertDialog } from "@tarve/core";Usage
import { AlertDialog } from "@tarve/core";
let open = true;
<AlertDialog
open={open}
title="Delete project?"
description="This action cannot be undone."
actionLabel="Delete"
actionVariant="destructive"
onAction={() => console.log("deleted")}
onOpenChange={(next) => {
open = next;
}}
/>Props
| Prop | Type | Default |
|---|---|---|
open required | boolean | — |
title required | string | — |
actionDisabled | boolean | — |
actionLabel | string | "Continue" |
actionVariant | ButtonProps["variant"] | "default" |
cancelLabel | string | "Cancel" |
closeOnEscape | boolean | false |
description | string | — |
onAction | () => void | — |
onCancel | () => void | — |
onOpenChange | (open: boolean) => void | — |
Common props
Shared by every component. See descriptions →
childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyleTypes
interface ButtonProps extends BaseProps {
variant?: ButtonVariant;
size?: "sm" | "default" | "lg";
disabled?: boolean;
control?: Control;
onClick?: () => void;
onHover?: (hovered: boolean) => void;
}