> For the complete documentation index, see [llms.txt](https://assetstore.essentialkit.voxelbusters.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://assetstore.essentialkit.voxelbusters.com/features/native-ui/playmaker/use-cases/use-case-1-confirmation-dialog.md).

# Confirmation Dialog

## Goal

Show a native alert and branch based on which button the user pressed.

## Actions used

* `NativeUIShowAlert`

## Variables

* `pressedButtonIndex` (Int)
* `pressedButtonLabel` (String)

## Flow

1. State: `ShowConfirmation`
   * Action: `NativeUIShowAlert`
   * Example inputs:
     * `title`: `"Delete Item?"`
     * `message`: `"This action cannot be undone."`
     * `buttonLabels`: `["Delete"]`
     * `cancelButtonLabel`: `"Cancel"`
   * Events:
     * `buttonClickedEvent` → `Confirmed`
     * `cancelClickedEvent` → `Cancelled`
2. State: `Confirmed`
   * Perform the action.
3. State: `Cancelled`
   * Do nothing / go back.

## Notes

* `buttonClickedEvent` is sent for any non-cancel button. Use `pressedButtonIndex` / `pressedButtonLabel` if you have multiple buttons.
