Skip to Content

Alert Dialog

Display confirmation dialogs with accept/cancel actions. Supports markdown in the content field.

Exports

ExportParametersReturns
AlertDialog(data)'confirm' or 'cancel'
CloseAlertDialog()

AlertDialog Parameters

ParameterTypeRequiredDescription
headerstringYesDialog title
contentstringYesDialog message — supports markdown
cancelbooleanNoShow cancel button (default: false)
sizestringNoModal size: 'xs', 'sm', 'md', 'lg', 'xl'
labels.cancelstringNoCustom cancel button text
labels.confirmstringNoCustom confirm button text

Usage

Confirmation Dialog

local result = exports['flux-ui-pack']:AlertDialog({ header = 'Confirm Action', content = 'Are you sure you want to proceed?', cancel = true }) if result == 'confirm' then print('User confirmed') else print('User cancelled') end

Custom Button Labels

local result = exports['flux-ui-pack']:AlertDialog({ header = 'Delete Vehicle', content = 'This action **cannot** be undone.', cancel = true, labels = { cancel = 'Keep', confirm = 'Delete' } })

Information Dialog

exports['flux-ui-pack']:AlertDialog({ header = 'Notice', content = 'Your vehicle has been impounded.' })

Close Dialog

exports['flux-ui-pack']:CloseAlertDialog()
Last updated on