> For the complete documentation index, see [llms.txt](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-ui/api/alert-and-confirm.md).

# Alert and Confirm

Simple dialogs for informational messages and yes/no prompts.

***

## Alert

A single-button notice. The callback fires when the player dismisses it.

```lua
exports['jiffy-ui']:Alert({
    title   = 'Account Banned',
    message = 'You have been banned. Appeal at discord.gg/example.',
    type    = 'error',
    btn     = 'OK',       -- button label (default: 'OK')
}, function()
    -- fired after dismissal
end)
```

**Server relay:**

```lua
exports['jiffy-ui']:Alert(source, data)
```

***

## Confirm

A two-button prompt. The callback receives `true` when confirmed, `false` when cancelled or dismissed with Esc.

```lua
exports['jiffy-ui']:Confirm({
    title   = 'Delete Vehicle?',
    message = 'This will permanently remove the vehicle from your garage.',
    type    = 'warning',
    confirm = 'Delete',   -- confirm button label (default: 'Confirm')
    cancel  = 'Keep',     -- cancel button label (default: 'Cancel')
}, function(confirmed)
    if confirmed then
        -- player pressed Delete
    end
end)
```

**Server relay:**

```lua
exports['jiffy-ui']:Confirm(source, data)
```

***

## Types

Both Alert and Confirm accept the same `type` values as Notify: `success`, `error`, `warning`, `info`, `primary`. The type controls the accent bar color on the dialog.
