Skip to content

Item types ​

Every row has the common fields (id, label, sublabel, description, icon, tint, permissions, callbacks…). The table lists the extra fields per type and the value your onChange receives.

Item types

TypeExtra fieldsonChange(value) / onSelect valueNotes
buttonrightLabel (string), key (string, key cap like 'F2')–Enter runs onSelect
actionvariant ('confirm' | 'danger' | 'warning'), hold (ms), confirm (true | table)–hold = hold Enter to confirm; confirm asks a dialog first
infovalue (string)–Read-only. Not selectable with Enter
numbervalue, min, max, step, bigStep (numbers), unit (string), format (fn)numberStepper. Left / right changes by step, Shift by bigStep
listoptions (array of strings / numbers or { label, value }), index (1-based), wrap (bool, default true), formatnumber (index, 1-based)Position dots under the value. Read item.options[index] for the value
slidervalue, min, max, step, bigStep, unit, formatnumberSame keys as number, plus mouse wheel
colorvalue ('#RRGGBB'), palette (array of hex strings)string ('#rrggbb', lowercase)Opens a picker with the palette and a hex field
inputvalue, inputType ('text' | 'number' | 'password' | 'money'), placeholder, maxLength, min, max, unitstring, or number for number / moneyEnter edits inline (takes focus in walk mode). money is floored to whole numbers
keybindvalue (key name, e.g. 'F2')string (FiveM key name)Enter starts a "press a key" capture
checkboxchecked (bool)booleanMulti-select
radiogroup (string), checked (bool)trueOnly the newly checked row fires. Lua unchecks the rest of the group in the same menu
switchchecked (bool)boolean
submenumenu (menu id) or build (fn), count (number)–build(childId, item, parent) returns items or a definition. See Submenus
link––Opens another UI. Shows an external icon and closes the menu after onSelect (unless close = false)
sectionlabel–Small capitals heading. Not selectable
separator––Divider line. Not selectable

Value rules ​

  • number and slider values are clamped to min / max on the Lua side. list indexes outside the options are rejected and the row snaps back.
  • format(value, item, menu) runs in Lua and its result is sent as the display text. The web keeps the old text until the new one arrives.
  • The current value is written back into the item (value, index or checked), so getItem and a reopened menu show it.
  • input text is capped at maxLength (max 4096). Colours accept #rgb, #rrggbb and rrggbb.

Row states ​

FieldTypeEffect
disabledbooleanGreyed out, Enter plays the error sound
disabledReasonstringShown on a disabled row (also filled by showLocked)
loadingbooleanSpinner. The row can't be used
badgenumber | string | trueCount, short label (≤ 16 chars) or a dot
cooldownnumber (ms) | { remaining, total }Countdown bar. Using the row shows a "Not ready yet" toast
pinnedcomputedSet by np_menu when the player pinned the row (hold Y). Pinned rows of a grid menu appear in its dock
visibleboolean | fn(item, menu)false hides the row

Text limits ​

The serializer trims text before it goes to the web: label / sublabel 160, description 1024, rightLabel 80, placeholder 120, unit 16, key 24 characters. Icons must be plain Font Awesome names ('car-side'); fa-solid prefixes are stripped.

np_* FiveM resources