Skip to main content
The bridge ships two list UIs, both with option callbacks that live in your resource:
  • Bridge.Menu — a side-anchored, navigable list that can hold buttons, toggles, and steppers. A toggle/stepper change keeps the menu open; selecting a button closes it.
  • Bridge.Context — a simpler list of actions, each a title + description that closes on select.
Neither blocks — you hand the menu your onSelect / onChange callbacks and they fire when the player interacts.
Bridge.Menu is keyboard-driven and keeps the player moving. It navigates with the arrow keys (up/down to move, left/right to step, Enter to choose, Backspace/Escape to close) and opens with SetNuiFocusKeepInput, so the player can still walk around while the menu is open — the ox_lib registerMenu feel. Bridge.Context is mouse-driven and takes the cursor (the player stands still while it’s open).

Availability

Client only.
Bridge.Menu.Open(def)
Bridge.Context.Open(def)

Signature

Bridge.Menu.Open(def)
title
string
The menu heading.
subtitle
string
A muted second line under the title.
icon
string
An icon shown in the header.
canClose
boolean
default:"true"
Whether the player can dismiss the menu without selecting.
options
table[]
required
The rows. Each option is shaped below.
onClose
function
Called when the menu closes (after a select, or on dismiss).

Option fields

options[].type
string
default:"button"
button, toggle, stepper, or separator.
options[].label
string
The row text.
options[].description
string
A muted sub-line.
options[].icon
string
A leading icon.
options[].disabled
boolean
Greys the row out and blocks selection.
options[].checked
boolean
For toggle rows — the initial on/off state.
options[].values
string[]
For stepper rows — the list of values to cycle through.
options[].index
number
default:"0"
For stepper rows — the starting index into values.
options[].arrow
boolean
Shows a submenu arrow on the right (you handle opening the next menu in onSelect).
options[].onSelect
function
Called when a button row is chosen. The menu then closes.
options[].onChange
function
Called with the new value when a toggle (boolean) or stepper (selected value) changes. The menu stays open.

Examples

Bridge.Menu.Open({
    title = 'Vehicle',
    options = {
        { label = 'Lock',  icon = 'lock',  onSelect = function() lock() end },
        { label = 'Trunk', icon = 'box',   onSelect = function() openTrunk() end },
    },
})
onChange keeps the menu open so the player can flip several toggles/steppers in one session. Only a button onSelect (or a dismiss) ends the menu.

Context

A flatter list — each item is a clickable action that closes the menu on select.

Signature

Bridge.Context.Open(def)
title
string
The heading.
options
table[]
required
The items (also accepted under items).
onClose
function
Called when the context menu closes.

Item fields

options[].title
string
required
The item text (also accepted as label).
options[].description
string
A muted sub-line.
options[].icon
string
A leading icon.
options[].disabled
boolean
Greys the item out and blocks selection.
options[].onSelect
function
Called when the item is chosen. The menu then closes.

Example

Bridge.Context.Open({
    title = 'Actions',
    options = {
        { title = 'Inspect', description = 'Look closer', icon = 'eye',
          onSelect = function() inspect() end },
        { title = 'Pick up', description = 'Add to inventory', icon = 'hand',
          onSelect = function() pickUp() end },
    },
})
Both menus tint their selection highlight, icons, and toggles to the player’s theme accent. Set atlas:ui "ox" (or atlas:ui:menu / atlas:ui:context) to render the same calls through ox_lib instead.