> ## Documentation Index
> Fetch the complete documentation index at: https://docs.attio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# confirm()

> Shows a confirmation prompt to the user

<img className="dark:hidden" width="720" height="440" noZoom src="https://mintcdn.com/attio/4Fh2EPa8-SlLTNAV/images/confirm.png?fit=max&auto=format&n=4Fh2EPa8-SlLTNAV&q=85&s=248fdd310992d741884c7e40d229d2f1" data-path="images/confirm.png" />

<img className="hidden dark:block" width="720" height="440" noZoom src="https://mintcdn.com/attio/4Fh2EPa8-SlLTNAV/images/confirm-dark.png?fit=max&auto=format&n=4Fh2EPa8-SlLTNAV&q=85&s=dc9999ba226e6e5406134b3007557d18" data-path="images/confirm-dark.png" />

```js theme={"system"}
import {confirm} from "attio/client"
```

Analogous to the
[`window.confirm()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm)
function in web browser JavaScript. The popup is
[modal](https://en.wikipedia.org/wiki/Modal_window).

<Tip>
  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?".
</Tip>

## API

```ts TypeScript theme={"system"}
async function confirm(options: Options): Promise<boolean>
```

## Options

<ParamField path="title" type="string" required>
  The title of the confirm pop-up.
</ParamField>

<ParamField path="text" type="string" required>
  The text of the confirm pop-up.
</ParamField>

<ParamField path="confirmLabel" type="string">
  The label for the confirm button.

  Defaults to `"OK"`.
</ParamField>

<ParamField path="cancelLabel" type="string">
  The label for the cancel button.

  Defaults to `"Cancel"`.
</ParamField>

<ParamField path="confirmVariant" type="'primary' | 'secondary' | 'secondary-destructive' | 'destructive'">
  The style of the confirm button.

  Defaults to `"primary"`.
</ParamField>
