Skip to content

Setup

Starting at v4.0.0 there are two versions for FiveM: Legacy and Enhanced. Legacy is for FiveM for GTA V (.NET Framework 4.5.2, CitizenFX.Core). Enhanced is for FiveM for GTA V Enhanced (.NET 10, CitizenFX.FiveM.Client). Both have the same features and the same version number.


Terminal window
dotnet add package MenuAPI.FiveM.Enhanced

MenuAPI.FiveM.Enhanced on nuget.org

Your build output gets MenuAPI.dll and a menuapi folder. Don’t edit that folder, it’s replaced on every update.


Menus are drawn with NUI. Create index.html next to your fxmanifest.lua:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My Resource</title>
<link rel="stylesheet" href="menuapi/colour-list.min.css">
<link rel="stylesheet" href="menuapi/menuapi.min.css">
</head>
<body style="margin: 0; background: transparent; overflow: hidden;">
<div id="menuapi"></div>
<script src="menuapi/sprite-cache.min.js"></script>
<script src="menuapi/glare.min.js"></script>
<script src="menuapi/colour-list.min.js"></script>
<script src="menuapi/menuapi.min.js"></script>
</body>
</html>

See How menus are drawn if you want to add your own things to the page.


ui_page 'index.html'
files {
'MenuAPI.dll',
'index.html',
'menuapi/**/*',
}

If you already have a files list, add the three lines to it.


using CitizenFX.FiveM.Client;
using CitizenFX.FiveM.Shared.Script;
using MenuAPI;
public class MyMenu : IScript
{
public MyMenu()
{
Menu menu = new Menu("My Resource", "Main Menu");
MenuController.AddMenu(menu);
menu.AddMenuItem(new MenuItem("Hello!", "My very first menu item."));
}
}

Press M in game to open it. Players can change that key, see Key bindings.

The API Reference has everything else. The TestMenu in the repository uses every item type.


See When something is wrong.