Skip to Content

List Menu

Scrollable list menus with selectable options. Items with scrollable values display the currently selected value name prominently, with the item label shown above it. The description for the currently highlighted item is shown in a panel below the menu.

Exports

ExportParametersReturns
RegisterMenu(data, cb)—
ShowMenu(id)—
HideMenu(onExit)—
GetOpenMenu()string or nil
SetMenuOptions(id, options, index)—

RegisterMenu Parameters

ParameterTypeRequiredDescription
datatableYesMenu definition
cbfunctionYesCallback: function(selected, scrollIndex, args)

Data Fields

FieldTypeDescription
idstringUnique menu identifier
titlestringMenu title
positionstringMenu position: 'top-left', 'top-right', 'left', 'right', 'center'
canClosebooleanWhether the menu can be closed with ESC
optionstableArray of menu options
onClosefunctionCallback when menu is closed
onSelectedfunctionCallback when selection changes
onSideScrollfunctionCallback when scrolling through values

Option Fields

FieldTypeDescription
labelstringOption label
descriptionstringDescription shown in the bottom panel when this item is highlighted
iconstringFontAwesome icon name or image URL
iconColorstringCustom icon color
iconAnimationstringIcon animation: 'spin', 'beat', 'fade', 'bounce', 'shake'
valuestableArray of scrollable values (strings or { label, description } objects)
defaultIndexnumberDefault selected value index (1-based)
checkedbooleanShow as a toggle switch
progressnumberShow a progress bar (0–100)
colorSchemestringColor for the progress bar
closebooleanWhether selecting this item closes the menu

Usage

Register and Show

exports['flux-ui-pack']:RegisterMenu({ id = 'server_menu', title = 'Manage Server', options = { { label = 'Change Weather', description = 'Changes the weather to whatever is currently highlighted', values = { 'Extrasunny', 'Clear', 'Clouds', 'Smog', 'Foggy', 'Overcast', 'Rain', 'Thunder', 'Clearing', 'Snow', 'Blizzard', 'Snowlight', 'Xmas', 'Halloween', 'Neutral' }, icon = 'cloud', defaultIndex = 1 }, { label = 'Change Time', description = 'Changes the time to the specified hour', values = { '00:00', '01:00', '02:00', '03:00', '04:00', '05:00' }, icon = 'clock' }, { label = 'Get Radio List', description = 'Get a full list of players on the given radio frequency', icon = 'radio' }, { label = 'Pull Stash', description = 'Open a stash with the specified name', icon = 'box' }, } }, function(selected, scrollIndex, args) print('Selected: ' .. selected, 'Value index: ' .. tostring(scrollIndex)) end) exports['flux-ui-pack']:ShowMenu('server_menu')

Values with Descriptions

Values can be objects with their own descriptions, shown in the bottom panel when scrolled to:

exports['flux-ui-pack']:RegisterMenu({ id = 'weapon_menu', title = 'Select Weapon', options = { { label = 'Primary Weapon', values = { { label = 'Carbine Rifle', description = 'Standard issue assault rifle' }, { label = 'Pump Shotgun', description = 'Close range powerhouse' }, { label = 'SMG', description = 'Compact and fast firing' }, } } } }, function(selected, scrollIndex) print('Selected weapon index: ' .. scrollIndex) end)

Update Menu Options

exports['flux-ui-pack']:SetMenuOptions('server_menu', { { label = 'Water Bottle', values = { '$5', 'In Stock' } }, { label = 'Bread', values = { '$3', 'Sold Out' } }, })

Hide Menu

exports['flux-ui-pack']:HideMenu()

Get Open Menu

local openMenu = exports['flux-ui-pack']:GetOpenMenu() if openMenu then print('Currently open: ' .. openMenu) end
Last updated on