Skip to content

ConfirmDialog

ConfirmDialog is a Prompt with Destructive always on. Use it to confirm an action that cannot be undone.

Usage

Call Components.ConfirmDialog with a scope and a table of properties:

C.ConfirmDialog(scope, {
    Layer = overlayLayer,
    Open = open,
    Title = "Delete project?",
    Body = "All files will be removed.",
    ConfirmText = "Delete",
    OnConfirm = deleteProject,
    OnClose = function()
        open:set(false)
    end,
})

Properties

Name Type Required Default Description
Title UsedAs<string> ✅ - Heading of the dialog.
Body UsedAs<string> ❌ - Text under the heading.
Children any ❌ - Custom content under the body.
Actions { DialogAction } ❌ - Buttons to use instead of the Cancel and confirm pair.
ConfirmText string ❌ "OK" Label of the confirm button.
Open UsedAs<boolean> ❌ - Whether the dialog is shown. Follows the state you pass.
Icon string ❌ - Lucide icon above the title.
IconColor UsedAs<Color3> ❌ - Colour of the icon. It is red by default when an icon is set.
IconSize number ❌ - Size of the icon in pixels.

Callbacks

Name Description
OnClose: () -> () Runs when the user cancels or presses the scrim.
OnConfirm: () -> () Runs when the user presses the confirm button. When left out, OnClose is called.

See also