Use NUI: create UI with HTML, CSS, and JavaScript
NUI (Native UI) is how you render HTML, CSS, and JavaScript on top of the GTA V game world. Every custom HUD, inventory screen, phone UI, and menu in FiveM runs through NUI. This lesson builds a functional NUI overlay from scratch - the foundation for every interface you will ever build.
Build it
Create the resource skeleton
resources/qu_nui_demo/
fxmanifest.lua
client.lua
html/
index.html
style.css
script.js
fx_version 'cerulean'
game 'gta5'
client_script 'client.lua'
ui_page 'html/index.html'
files {
'html/index.html',
'html/style.css',
'html/script.js',
}
ui_page tells FiveM which HTML file to load. files {} lists every file NUI needs so the client downloads them.