Skip to content
⚠️ Work in progress. MenuAPI for FiveM Enhanced is an early alpha. The library, its API, and these docs are still changing and may be incomplete or inaccurate.

MenuItem

A plain button: the simplest menu item there is. All other menu items inherit the ‘regular’ MenuItem class, so every property on this page also applies to them.

A MenuItem is also what you use to open a submenu.


MenuItem item = new MenuItem("Disabled Item Text", "An item description, that supports ~r~color codes~s~.");
// Disable the item
item.Enabled = false;
// Set the left item icon to the 'lock' icon.
item.LeftIcon = Icon.LOCK;
// Add a menu item to a menu:
menu.AddMenuItem(item);

Items are usually created with an object initializer, which keeps things a bit shorter:

menu.AddMenuItem(new MenuItem("Buy vehicle", "Costs $1000.")
{
Label = "$1000",
LeftIcon = MenuItem.Icon.CAR,
RightIcon = MenuItem.Icon.CASH
});

Pressing a plain menu item raises the OnItemSelect event on its parent menu:

MenuItem button = new MenuItem("Fix vehicle", "Repairs the vehicle you're in.");
menu.AddMenuItem(button);
menu.OnItemSelect += (_menu, _item, _index) =>
{
if (_item == button)
{
SetVehicleFixed(GetVehiclePedIsIn(PlayerPedId(), false));
}
};
Menu submenu = new Menu("Vehicle options");
MenuItem submenuButton = new MenuItem("Vehicle options", "Open the vehicle options.")
{
Label = "→→→"
};
menu.AddMenuItem(submenuButton);
MenuController.BindMenuItem(menu, submenu, submenuButton);


Creates a new menu item without a description.

Parameter Type Description
text string The text displayed on the left side of the item.

Creates a new menu item with a description, which is shown in the box below the menu while the item is highlighted.

Parameter Type Description
text string The text displayed on the left side of the item.
description string The description shown below the menu while this item is selected. Pass null for no description.

Property Type Default value Description Optional
Text String - The text to display on the left side of the menu item No
Description String Null A description text which will be displayed below the menu, when this menu item is currently selected. Yes
Label String Null Text that is displayed on the right side of the item.¹ Yes
LeftIcon Icon Icon.NONE An Icon that will appear on the left side of the menu item.¹ Yes
RightIcon Icon Icon.NONE An Icon that will appear on the right side of the menu item.¹ Yes
Enabled boolean true If set to false, the menu item will be grayed out and can not be toggled on/off. Yes
Index int -1 (Getter only) Gets the position of this menu item in the current menu. Returns -1 if this menu item is not inside a menu. Yes
Selected boolean false (Getter only) Gets whether or not this menu item is currently highlighted (if the current menu index is the same as this menu item index). Returns false by default if this menu item is not in a menu. Yes
ParentMenu Menu Null This is mainly used internally to get and set this item’s parent menu. This is to avoid having to manually scan all menu’s for this menu item. Yes
PositionOnScreen int 0 (Getter only) Gets the current screen position of this item. Yes
ItemData dynamic Null Allows you to attach data to a menu item if you want to identify the menu item without having to put identification info in the visible text or description. Yes

¹ Not available for all MenuItem types.


There are no methods available for the standard MenuItem type.

Everything you would do to an item is done through its menu instead:

I want to… Use
Press an item from code Menu.SelectItem()
Remove an item Menu.RemoveMenuItem()
Highlight an item Menu.RefreshIndex()
Bind a submenu to an item MenuController.BindMenuItem()

ItemData is a dynamic property that lets you hang whatever you like on a menu item, so you do not have to encode identifying information in the visible text or description. This is the easiest way to handle menus that are built in a loop.

foreach (var vehicle in vehicles)
{
menu.AddMenuItem(new MenuItem(vehicle.DisplayName, $"Spawn a {vehicle.DisplayName}.")
{
ItemData = vehicle
});
}
menu.OnItemSelect += (_menu, _item, _index) =>
{
if (_item.ItemData != null)
{
SpawnVehicle(_item.ItemData.Model);
}
};

Because ItemData is dynamic, anything works: a string, an int, an anonymous object, or one of your own classes.

// An anonymous object.
item.ItemData = new { category = "vehicles", price = 1000 };
// Then filter on it.
menu.FilterMenuItems(i => i.ItemData?.category == "vehicles");

Item text, labels and descriptions all support the game’s text formatting codes.

Code Effect
~r~ Red
~b~ Blue
~g~ Green
~y~ Yellow
~p~ Purple
~o~ Orange
~c~ Grey
~w~ White
~s~ Resets back to the default color
~n~ New line
~h~ Bold (toggles)
MenuItem item = new MenuItem(
"~b~Important~s~ button",
"This description has a ~r~red~s~ word in it, and~n~a second line."
);

The Icon (enum) is a list of all icons (sprites) which can be used in MenuItems.

Index Icon name Example
0 Icon.NONE n/a
1 Icon.LOCK Icon
2 Icon.STAR Icon
3 Icon.WARNING Icon
4 Icon.CROWN Icon
5 Icon.MEDAL_BRONZE Icon
6 Icon.MEDAL_GOLD Icon
7 Icon.MEDAL_SILVER Icon
8 Icon.CASH Icon
9 Icon.COKE Icon
10 Icon.HEROIN Icon
11 Icon.METH Icon
12 Icon.WEED Icon
13 Icon.AMMO Icon
14 Icon.ARMOR Icon
15 Icon.BARBER Icon
16 Icon.CLOTHING Icon
17 Icon.FRANKLIN Icon
18 Icon.BIKE Icon
19 Icon.CAR Icon
20 Icon.GUN Icon
21 Icon.HEALTH_HEART Icon
22 Icon.MAKEUP_BRUSH Icon
23 Icon.MASK Icon
24 Icon.MICHAEL Icon
25 Icon.TATTOO Icon
26 Icon.TICK Icon
27 Icon.TREVOR Icon
28 Icon.FEMALE Icon
29 Icon.MALE Icon
30 Icon.LOCK_ARENA Icon
31 Icon.ADVERSARY Icon
32 Icon.BASE_JUMPING Icon
33 Icon.BRIEFCASE Icon
34 Icon.MISSION_STAR Icon
35 Icon.DEATHMATCH Icon
36 Icon.CASTLE Icon
37 Icon.TROPHY Icon
38 Icon.RACE_FLAG Icon
39 Icon.RACE_FLAG_PLANE Icon
40 Icon.RACE_FLAG_BICYCLE Icon
41 Icon.RACE_FLAG_PERSON Icon
42 Icon.RACE_FLAG_CAR Icon
43 Icon.RACE_FLAG_BOAT_ANCHOR Icon
44 Icon.ROCKSTAR Icon
45 Icon.STUNT Icon
46 Icon.STUNT_PREMIUM Icon
47 Icon.RACE_FLAG_STUNT_JUMP Icon
48 Icon.SHIELD Icon
49 Icon.TEAM_DEATHMATCH Icon
50 Icon.VEHICLE_DEATHMATCH Icon
51 Icon.MP_AMMO_PICKUP Icon
52 Icon.MP_AMMO Icon
53 Icon.MP_CASH Icon
54 Icon.MP_RP Icon
55 Icon.MP_SPECTATING Icon
56 Icon.SALE Icon
57 Icon.GLOBE_WHITE Icon
58 Icon.GLOBE_RED Icon
59 Icon.GLOBE_BLUE Icon
60 Icon.GLOBE_YELLOW Icon
61 Icon.GLOBE_GREEN Icon
62 Icon.GLOBE_ORANGE Icon
63 Icon.INV_ARM_WRESTLING Icon
64 Icon.INV_BASEJUMP Icon
65 Icon.INV_MISSION Icon
66 Icon.INV_DARTS Icon
67 Icon.INV_DEATHMATCH Icon
68 Icon.INV_DRUG Icon
69 Icon.INV_CASTLE Icon
70 Icon.INV_GOLF Icon
71 Icon.INV_BIKE Icon
72 Icon.INV_BOAT Icon
73 Icon.INV_ANCHOR Icon
74 Icon.INV_CAR Icon
75 Icon.INV_DOLLAR Icon
76 Icon.INV_COKE Icon
77 Icon.INV_KEY Icon
78 Icon.INV_DATA Icon
79 Icon.INV_HELI Icon
80 Icon.INV_HEORIN Icon
81 Icon.INV_KEYCARD Icon
82 Icon.INV_METH Icon
83 Icon.INV_BRIEFCASE Icon
84 Icon.INV_LINK Icon
85 Icon.INV_PERSON Icon
86 Icon.INV_PLANE Icon
87 Icon.INV_PLANE2 Icon
88 Icon.INV_QUESTIONMARK Icon
89 Icon.INV_REMOTE Icon
90 Icon.INV_SAFE Icon
91 Icon.INV_STEER_WHEEL Icon
92 Icon.INV_WEAPON Icon
93 Icon.INV_WEED Icon
94 Icon.INV_RACE_FLAG_PLANE Icon
95 Icon.INV_RACE_FLAG_BICYCLE Icon
96 Icon.INV_RACE_FLAG_BOAT_ANCHOR Icon
97 Icon.INV_RACE_FLAG_PERSON Icon
98 Icon.INV_RACE_FLAG_CAR Icon
99 Icon.INV_RACE_FLAG_HELMET Icon
100 Icon.INV_SHOOTING_RANGE Icon
101 Icon.INV_SURVIVAL Icon
102 Icon.INV_TEAM_DEATHMATCH Icon
103 Icon.INV_TENNIS Icon
104 Icon.INV_VEHICLE_DEATHMATCH Icon
105 Icon.AUDIO_MUTE Icon
106 Icon.AUDIO_INACTIVE Icon
107 Icon.AUDIO_VOL1 Icon
108 Icon.AUDIO_VOL2 Icon
109 Icon.AUDIO_VOL3 Icon
110 Icon.COUNTRY_USA Icon
111 Icon.COUNTRY_UK Icon
112 Icon.COUNTRY_SWEDEN Icon
113 Icon.COUNTRY_KOREA Icon
114 Icon.COUNTRY_JAPAN Icon
115 Icon.COUNTRY_ITALY Icon
116 Icon.COUNTRY_GERMANY Icon
117 Icon.COUNTRY_FRANCE Icon
118 Icon.BRAND_ALBANY Icon
119 Icon.BRAND_ANNIS Icon
120 Icon.BRAND_BANSHEE Icon
121 Icon.BRAND_BENEFACTOR Icon
122 Icon.BRAND_BF Icon
123 Icon.BRAND_BOLLOKAN Icon
124 Icon.BRAND_BRAVADO Icon
125 Icon.BRAND_BRUTE Icon
126 Icon.BRAND_BUCKINGHAM Icon
127 Icon.BRAND_CANIS Icon
128 Icon.BRAND_CHARIOT Icon
129 Icon.BRAND_CHEVAL Icon
130 Icon.BRAND_CLASSIQUE Icon
131 Icon.BRAND_COIL Icon
132 Icon.BRAND_DECLASSE Icon
133 Icon.BRAND_DEWBAUCHEE Icon
134 Icon.BRAND_DILETTANTE Icon
135 Icon.BRAND_DINKA Icon
136 Icon.BRAND_DUNDREARY Icon
137 Icon.BRAND_EMPORER Icon
138 Icon.BRAND_ENUS Icon
139 Icon.BRAND_FATHOM Icon
140 Icon.BRAND_GALIVANTER Icon
141 Icon.BRAND_GROTTI Icon
142 Icon.BRAND_GROTTI2 Icon
143 Icon.BRAND_HIJAK Icon
144 Icon.BRAND_HVY Icon
145 Icon.BRAND_IMPONTE Icon
146 Icon.BRAND_INVETERO Icon
147 Icon.BRAND_JACKSHEEPE Icon
148 Icon.BRAND_LCC Icon
149 Icon.BRAND_JOBUILT Icon
150 Icon.BRAND_KARIN Icon
151 Icon.BRAND_LAMPADATI Icon
152 Icon.BRAND_MAIBATSU Icon
153 Icon.BRAND_MAMMOTH Icon
154 Icon.BRAND_MTL Icon
155 Icon.BRAND_NAGASAKI Icon
156 Icon.BRAND_OBEY Icon
157 Icon.BRAND_OCELOT Icon
158 Icon.BRAND_OVERFLOD Icon
159 Icon.BRAND_PED Icon
160 Icon.BRAND_PEGASSI Icon
161 Icon.BRAND_PFISTER Icon
162 Icon.BRAND_PRINCIPE Icon
163 Icon.BRAND_PROGEN Icon
164 Icon.BRAND_PROGEN2 Icon
165 Icon.BRAND_RUNE Icon
166 Icon.BRAND_SCHYSTER Icon
167 Icon.BRAND_SHITZU Icon
168 Icon.BRAND_SPEEDOPHILE Icon
169 Icon.BRAND_STANLEY Icon
170 Icon.BRAND_TRUFFADE Icon
171 Icon.BRAND_UBERMACHT Icon
172 Icon.BRAND_VAPID Icon
173 Icon.BRAND_VULCAR Icon
174 Icon.BRAND_WEENY Icon
175 Icon.BRAND_WESTERN Icon
176 Icon.BRAND_WESTERNMOTORCYCLE Icon
177 Icon.BRAND_WILLARD Icon
178 Icon.BRAND_ZIRCONIUM Icon
179 Icon.INFO Icon