Skip to main content
List menus are compact, keyboard-only menus navigated with the arrow keys - a modern drop-in replacement for ox_lib’s lib.registerMenu/lib.showMenu with the same callbacks, indices, and keybinds. Rows can side-scroll through values, toggle checkboxes, and display progress bars, with a built-in description panel and contextual key hints.
Looking for the mouse-driven menu with submenus and hover metadata? That’s the Menu component. The list menu is its keyboard-only sibling: flat, single-level, and driven entirely by arrow keys.

Quick Start

Functions

Register a new list menu with the specified configuration.
Parameters:
  • menuData (table) - Menu configuration object (see Registration Options)
  • cb (function, optional) - Called when an option is confirmed with Enter: cb(selected, scrollIndex, args, checked)
Display a previously registered list menu.
Parameters:
  • menuId (string) - Unique identifier of the menu to display
  • startIndex (number, optional) - 1-based option to highlight on open
Hide the currently displayed list menu.
Parameters:
  • onExit (boolean, optional) - true also fires the menu’s onClose callback
Replace a registered menu’s options - a single option (with index) or all of them.
Parameters:
  • menuId (string) - Unique identifier of the menu to update
  • options (table) - A single option (when index is given) or an array of options
  • index (number, optional) - 1-based option index to replace
If the menu is currently open, the change applies live - no re-register or re-open needed. The player’s selection is kept.
Get the ID of the currently open list menu.
Returns:
  • menuId (string | nil) - The ID of the currently open list menu, or nil if none is open

Keyboard Controls

While a list menu is open the cursor stays hidden and the player keeps game input (walking, driving) unless disableInput = true. Firing, the weapon wheel, and melee are always disabled.

Configuration

Registration Options

id
string
required
Unique menu identifier
title
string
required
Menu title (supports markdown)
subtitle
string
Menu subtitle (supports markdown)
icon
string
FontAwesome icon class or image URLSupported image formats: .png, .webp, .jpg, .jpeg, .gif, .svg
iconColor
string
default:"#9CA3AF"
Icon color (hex or CSS color name)
iconAnimation
string
Icon animation: 'spin', 'spinPulse', 'spinReverse', 'pulse', 'beat', 'fade', 'beatFade', 'bounce', 'shake'
position
string
default:"top-left"
Menu position. Available options: 'top-left', 'top-right', 'bottom-left', 'bottom-right'
canClose
boolean
default:"true"
Whether the menu can be closed with ESC/Backspace
disableInput
boolean
default:"false"
true freezes game input while the menu is open (by default the player keeps moving control)
onClose
function
Called when the menu is closed by the player: onClose(keyPressed) where keyPressed is 'Escape', 'Backspace', or nil when closed via hideListMenu(true)
onSelected
function
Called when the highlighted option changes: onSelected(selected, secondary, args)secondary is the 1-based scroll index on a values option, or the checked state on a checkbox option
onSideScroll
function
Called when a values option is scrolled: onSideScroll(selected, scrollIndex, args)
onCheck
function
Called when a checkbox option is toggled: onCheck(selected, checked, args)
options
table
required
Array of menu options (see Option Properties)

Option Properties

label
string
required
Option display text (supports markdown)
icon
string
FontAwesome icon class or image URLSupported image formats: .png, .webp, .jpg, .jpeg, .gif, .svg
iconColor
string
default:"#9CA3AF"
Icon color (hex or CSS color name)
iconAnimation
string
Icon animation typeAvailable options: 'spin', 'spinPulse', 'spinReverse', 'pulse', 'beat', 'fade', 'beatFade', 'bounce', 'shake'
description
string
Shown in the description panel below the list while this option is selected (supports markdown)
values
table
Makes the option side-scrollable with / (see Values)
defaultIndex
number
default:"1"
1-based initial scroll index for a values option
checked
boolean
Makes the option a checkbox toggled in place with Enter. Set true or false for the initial state - the presence of the field is what creates the checkbox
progress
number
Progress bar value (0-100) rendered under the label
progressColor
string
default:"#3B82F6"
Progress bar color (hex or CSS color name)
Can also use colorScheme as an alias
disabled
boolean
default:"false"
Rendered dimmed and skipped by keyboard navigation
close
boolean
default:"true"
Whether confirming this option closes the menu (false keeps it open)
args
table
Arguments passed to the confirm callback and events
onSelect
function
Callback executed when the option is confirmed: onSelect(selected, scrollIndex, args)
event
string
Client event to trigger when the option is confirmed
serverEvent
string
Server event to trigger when the option is confirmed

Values

Each entry in values is either a plain string or an object with its own description, which replaces the option’s description while that value is selected:

Behavior Notes

  • Live updates - setListMenuOptions applies to an open menu immediately, keeping the player’s selection.
  • State persistence - scroll positions and checkbox states are remembered when a menu is closed and re-shown. Re-register the menu to reset them.
  • Switching menus - calling showListMenu while another list menu is open switches directly without firing the first menu’s onClose.

Migrating from ox_lib

The API is deliberately signature-compatible with ox_lib’s list menu - same 1-based indices, same callbacks, same keybinds:
Using our ox_lib fork? lib.registerMenu and friends forward to the list menu automatically while lation_ui is running - existing scripts need no changes at all.

Preview

List Menu Preview
List Menu Preview