Installation
Requirements
- A recent FiveM server artifact (Lua 5.4)
- Node 18+ to build the NUI once
Nothing else is required: no database, no ox_lib, no streamed assets. Optional, auto-detected at start:
| Kind | Resources | Used for |
|---|---|---|
| Framework | qbx_core, qb-core, es_extended | Jobs and groups on rows and server actions, money for the shops and "Give money", character name, death state |
| Vehicle keys | qbx_vehiclekeys, qb-vehiclekeys | Key check for the built-in lock / unlock and "Give keys" (Config.Interact.lockMode = 'auto') |
| Inventory | ox_inventory or the framework inventory | Repair kits for the context menu "Repair" option (Config.Context.repair.item) |
Steps
- Put the resource in
resources/asnp_menu. The NUI callbacks usehttps://np_menu/…, so keep the name. - Build the NUI:shThis creates
cd web && npm ci && npm run buildweb/dist, whichfxmanifest.lualoads as theui_page. - Start it after the framework, because the bridge is picked once at start:cfg
ensure qbx_core # or qb-core / es_extended (optional) ensure np_menu ensure my_resource # resources that register menus come after np_menu - Give your staff the admin ace. It unlocks the dev / admin menu, the "Admin" tile in the quick menu and every admin server action:cfgThe ace name is
add_ace group.admin np_menu.admin allowConfig.Admin.ace. Runnpmenu_aces_reset(console or an admin) after changing aces at runtime so clients re-query them.
Test it
Press F10 as an admin for the dev menu, F1 for the quick menu, hold Left Alt for the radial wheel and hold G while looking at a vehicle for the context menu. /menusettings opens the player settings.
Optional next steps
- Switch off built-in menus you don't want: Built-in menus.
- Set a brand colour: Theming & settings.
- Already using ox_lib menus? Turn on
Config.OxCompat: ox_lib compatibility. - Standalone servers: groups map to aces.
groups = 'police'on a server action checksnp_menu.group.police:cfgadd_ace group.police np_menu.group.police allow
Using np_menu from another resource
Call the exports directly:
lua
exports.np_menu:register({ id = 'my_menu', title = 'My menu', items = { ... } })
exports.np_menu:open('my_menu')Or load the OOP wrapper in your fxmanifest.lua:
lua
shared_script '@np_menu/import.lua'See Creating menus. Menus, radial items and context options that a resource registered are removed automatically when that resource stops.
Troubleshooting
| Symptom | Fix |
|---|---|
| Nothing shows up | web/dist is missing. Build the NUI. |
| F10 says "no permission" | Add the np_menu.admin ace to your group (step 4), then reconnect or run npmenu_aces_reset. |
| Shop purchases fail with "no framework" | Standalone has no money. The built-in shops need qbx, qb or ESX. |
| Jobs / groups never match | The framework started after np_menu. Fix the start order, or set Config.Framework explicitly. |
| Keys don't work | Players can rebind them in Settings → Key Bindings → FiveM. The config only sets the defaults. |
| Preview image doesn't load | The image host is not in Config.ImageHosts. |