Skip to main content
Alert dialogs provide a flexible way to show confirmations, warnings, informational messages, and more with support for markdown content, custom icons, and styled callouts.

Quick Start

local result = exports.lation_ui:alert({
    header = 'Delete Item',
    content = 'Are you sure you want to delete this item?',
    icon = 'fas fa-trash',
    iconColor = '#EF4444',
    type = 'error'
})

if result == 'confirm' then
    print('Item deleted!')
end

Functions

Opens an alert dialog and waits for user interaction.Returns:
  • 'confirm' - User clicked the confirm button
  • 'cancel' - User clicked cancel or closed the dialog
local result = exports.lation_ui:alert({
    header = 'Confirm Action',
    content = 'Do you want to continue?'
})
Programmatically closes any currently open alert dialog.
exports.lation_ui:closeAlert()

Configuration

Dialog Options

header
string
The dialog header text. Supports markdown formatting.
Either header or content must be provided.
content
string
The main content text displayed in the dialog. Supports markdown formatting.
Either header or content must be provided.
icon
string
FontAwesome icon class (e.g., 'fas fa-trash', 'fas fa-info-circle').
iconColor
string
default:"#71717A"
Icon color using hex code or CSS color name.
iconColor = '#EF4444'  -- Hex code
iconColor = 'red'      -- CSS color name
type
string
default:"default"
Dialog type that affects the overall styling.Options: 'default', 'info', 'success', 'warning', 'error'
size
string
default:"md"
Dialog size for responsive layouts.Options: 'xs', 'sm', 'md', 'lg', 'xl'
cancel
boolean
default:"true"
Whether to show the cancel button.
labels
table
default:"{ cancel = 'Cancel', confirm = 'Confirm' }"
Custom button labels for custom text.
labels = {
    cancel = 'No',
    confirm = 'Yes'
}
callouts
table
Array of callout objects to highlight important information within the dialog.See Callouts section below for detailed options.

Callouts

Callouts are styled information boxes that can be added to alert dialogs to emphasize critical information.
description
string
required
The callout content text. Supports markdown formatting.
label
string
The callout title/header. Supports markdown formatting.
type
string
default:"info"
Callout styling type.Options: 'info', 'success', 'warning', 'error'
icon
string
Custom FontAwesome icon. Inherits the color from the callout type.
icon = 'fas fa-rocket'

Preview

Alert dialog example