Skip to main content
Two blocking dialogs for asking the player something:
  • Bridge.Input — a modal form with one or more fields (text, number, select, slider, checkbox, …). Returns the entered values, or nil if cancelled.
  • Bridge.Confirm — a yes/no dialog with an optional danger styling. Returns a boolean.
Both block until the player answers, so call them inside a thread or callback.

Availability

Client only.
local values = Bridge.Input.Open(opts)    -- table | nil
local ok     = Bridge.Confirm.Open(opts)  -- boolean

Input

Signature

Bridge.Input.Open(opts)
title
string
default:"Input"
The dialog heading. Also accepted as heading.
icon
string
An icon shown in the header.
description
string
A muted sub-line under the title.
fields
table[]
required
The form fields, in order. Also accepted as rows. Each field is shaped below.
allowCancel
boolean
default:"true"
Whether the player can dismiss the form (clicking the backdrop or Cancel). When false, they must submit.

Field shape

fields[].type
string
required
One of text, number, password, select, checkbox, slider, textarea.
fields[].label
string
required
The field label.
fields[].description
string
Helper text shown under the field.
fields[].placeholder
string
Placeholder for text-like and select fields.
fields[].required
boolean
Marks the field with an accent asterisk.
fields[].options
table[]
For select fields — a list of { value, label } choices.
fields[].min
number
default:"0"
For slider fields — the minimum value.
fields[].max
number
default:"100"
For slider fields — the maximum value.
fields[].step
number
default:"1"
For slider fields — the increment.

Returns

values
table | nil
A list-style table of the entered values in field order (values[1], values[2], …). nil if the player cancelled.

Examples

CreateThread(function()
    local values = Bridge.Input.Open({
        title = 'Name your vehicle',
        fields = {
            { type = 'text',   label = 'Name', required = true },
            { type = 'number', label = 'Plate number' },
        },
    })
    if not values then return end       -- cancelled
    print(values[1], values[2])
end)
Bridge.Input.Open yields until the player submits or cancels. Call it inside a CreateThread, command, or event callback.

Confirm

A focused yes/no dialog. Returns true only if the player confirms.

Signature

Bridge.Confirm.Open(opts)
title
string
default:"Are you sure?"
The dialog heading.
description
string
default:"Choose an action to continue."
The body text.
confirmLabel
string
default:"Confirm"
The confirm button text.
cancelLabel
string
default:"Cancel"
The cancel button text.
intent
string
default:"default"
default or danger. danger styles the badge and confirm button in the destructive color.

Returns

confirmed
boolean
true if the player confirmed, false if they cancelled or dismissed.

Examples

CreateThread(function()
    if Bridge.Confirm.Open({ title = 'Drop this item?' }) then
        dropItem()
    end
end)
Both dialogs tint to the player’s theme accent (the confirm badge, the required-field asterisk), and danger confirms use the destructive color. Set atlas:ui "ox" (or atlas:ui:input / atlas:ui:confirm) to render the same calls through ox_lib instead.