AROYN UI LIBRARY / ADVANCED

Dialogs

Explicit decisions with adaptive sizing and a blocking modal lifecycle.

Confirm a decision#

LUAU
local dialog = window:Dialog({
    Type = "Confirm", Title = "Reset preferences?",
    Description = "Restore defaults without deleting saved profiles.",
    ConfirmText = "Reset", CancelText = "Keep", OutsideDismiss = true,
    OnConfirm = function()
        local ok, info = window:ResetConfig()
        if not ok then warn(info.Code, info.Message) end
    end,
    OnCancel = function(reason) print("Cancelled:", reason) end,
    OnDismiss = function(reason, actionId) print(reason, actionId) end,
})

Common arguments#

OptionTypeDefaultMeaning
TitlestringRequiredNonempty.
Descriptionstring""Wrapped text; long content scrolls.
TypeAlert | Confirm | CustomAlertDetermines actions.
Cancelablebooleanfalse for Alert; true otherwisePermits user cancellation and Escape.
OutsideDismissbooleanfalseTrue requires Cancelable=true.
OnCancelfunction(reason)?nilCancellation, including programmatic/lifecycle closing.
OnDismissfunction(reason, actionId)?nilAfter panel removal.

Type-specific arguments#

TypeOptionsCallbacks
AlertButtonText="OK"OnAcknowledge()
ConfirmCancelText="Cancel", ConfirmText="Confirm"OnConfirm()
CustomActions: 1–3 entries with unique Id, Text, optional Primary=falseEach action has optional Callback()
LUAU
window:Dialog({Type = "Alert", Title = "Saved", ButtonText = "OK",
    OnAcknowledge = function() print("Acknowledged") end})
window:Dialog({Type = "Custom", Title = "Choose an action", Actions = {
    {Id = "save", Text = "Save", Primary = true, Callback = function() print("Save") end},
    {Id = "skip", Text = "Skip", Callback = function() print("Skip") end},
}})

Returned methods#

MemberReturnsMeaning
IdstringGenerated request identifier.
GetState()stringQueued / Open / Closing / Closed.
GetDismissReason()string?Reason after closing.
GetAction()string?acknowledge, confirm, cancel, custom Id or nil.
Close(reason?)selfDefault programmatic; never implicitly confirms.

Queue and input gate#

Only one dialog is visible, with up to 64 FIFO requests waiting. Open includes the entry animation. The background remains blocked through the 160ms exit and queue handoff. Modal entry closes popups, ends Slider drag, releases text focus, cancels key capture and suspends shortcuts. Desired disabled state is preserved.

Callbacks and cancellation#

A deliberate action is fixed before its callback runs. OnConfirm, OnAcknowledge or an action Callback runs immediately once, not after the exit tween. OnDismiss runs after removal. Programmatic Close, Escape, outside click and lifecycle cancellation invoke OnCancel, never confirmation.

ReasonMeaning
action / cancelExplicit action or cancel button.
escape / outsideCancelable keyboard/outside interaction.
programmaticDefault Close().
page_changed / minimized / hidden / input_blocked / destroyedOwner lifecycle.
overflowQueue full.
Custom stringProvided to Close(reason).

Adaptive layout#

Panels use measured, wrapped content and viewport bounds. Long descriptions scroll while action buttons remain accessible. Narrow screens stack actions; short landscape can use a row when each action fits. A recommended minimum safe area is 280×190; extremely small viewports cannot show all text at once.