fivem-nui

Installation
SKILL.md

FiveM NUI

HTML/CSS/JS interfaces for FiveM: manifest setup, Lua-to-browser messages, NUI callbacks and focus handling.

Activation Contract

Load this skill when the user asks to create or edit a FiveM UI, writes HTML/CSS/JS inside a resource, sets ui_page, or asks about SendNUIMessage, SetNUIFocus or RegisterNUICallback.

Hard Rules

  • Declare ui_page and include every UI file in files in fxmanifest.lua; a missing file silently fails to load.
  • Reference assets with https://cfx-nui-<resource>/path; the nui:// protocol is deprecated.
  • RegisterNUICallback handlers must ALWAYS call cb(...) (at least cb({})), or the browser request hangs.
  • Browser calls callbacks with fetch('https://' + GetParentResourceName() + '/<name>', { method: 'POST', body: JSON.stringify(...) }); the URL name must match the registered name exactly.
  • SetNUIFocus(keyboard, mouse): always call SetNUIFocus(false, false) when closing the UI.
  • NUI callbacks run on the CLIENT. Validate their data client-side, then re-validate on the server before any state change; never trust UI-sent prices, amounts or ids.
  • Minimize SendNUIMessage calls: batch updates rather than sending per frame.
  • Debug with F8 and Chrome DevTools; test the page in a browser with a mock mode.
Installs
488
GitHub Stars
15
First Seen
Feb 21, 2026
fivem-nui — germanfndez/fiveai-skills