import {confirm} from "attio/client"

Analogous to the window.confirm() function in web browser JavaScript. The popup is modal.

It is useful when you need to get a yes/no answer back from the user, e.g. “Are you sure you want to delete this item?”.

API

TypeScript
async function confirm(options: Options): Promise<boolean>

Options

title : string

The title of the confirm pop-up.

text : string

The text of the confirm pop-up.

confirmLabel? : string

The label for the confirm button.

Defaults to "OK".

cancelLabel? : string

The label for the cancel button.

Defaults to "Cancel".

confirmVariant?: "primary" | "secondary" | "secondary-destructive" | "destructive"

The style of the confirm button.

Defaults to "primary".