skills/fivem-react-nui/SKILL.md
Builds NUI interfaces for FiveM using React 18 + TypeScript + Vite + Tailwind CSS v3 + Zustand. Use when the user mentions NUI, interface, UI, menu, HUD, panel, overlay, React, Vite, Tailwind, or any in-game interface for FiveM — regardless of the backend framework (vRP, QBCore, Qbox, ESX). Covers project structure, FiveM CEF restrictions, observe/Post hooks, VisibilityProvider, animations, dynamic config/theme, and performance rules.
npx skillsauth add proelias7/fivem-skill fivem-react-nuiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Stack: React 18 + TypeScript + Vite + Tailwind CSS v3.4.17 + Zustand
base: "./" in vite.config.ts — MANDATORY for assets to load in FiveMrem for ALL sizes — NEVER px for layout (scales with player resolution)backdrop-filter: blur(), filter: blur(), filter: drop-shadow() — cause FPS dropoverflow: hidden and user-select: noneVisibilityProviderVisibilityProvider with SetNuiFocusisEnvBrowser() for data mocking in devobserve() to listen to NUI messages, Post.create() to send callbacks// main.tsx
ReactDOM.createRoot(document.getElementById("root")!).render(
<ThemeProvider>
{/* Always visible — do not block game input */}
<NotifyComponent />
<ProgressComponent />
{/* Controlled by VisibilityProvider — requires NuiFocus */}
<HashRouter>
<VisibilityProvider>
<AppContent />
</VisibilityProvider>
</HashRouter>
</ThemeProvider>
);
observe<NotifyData>("module:notify", (data) => {
addNotify(data);
});
await Post.create("buy", { item: "water", qty: 1 });
-- Open
SendNUIMessage({ action = "setNui", nui = "panel", data = { ... } })
SetNuiFocus(true, true)
-- Close callback
RegisterNUICallback("removeFocus", function(data, cb)
SetNuiFocus(false, false)
cb("ok")
end)
ui_page "src/ui/build/index.html"
files {
"src/ui/build/index.html",
"src/ui/build/assets/*",
"src/ui/project/public/**/*",
}
{
"dependencies": {
"react": "^18", "react-dom": "^18",
"react-router-dom": "^7", "zustand": "^4",
"clsx": "^2", "tailwind-merge": "^3",
"lucide-react": "^0.5", "tailwindcss": "^3",
"autoprefixer": "^10", "postcss": "^8"
},
"devDependencies": {
"@vitejs/plugin-react-swc": "^3",
"typescript": "^5", "vite": "^5"
}
}
Avoid: MUI, Chakra UI, Ant Design, framer-motion, styled-components — all too heavy for FiveM CEF.
For the full implementation guide (project structure, vite.config, responsive system, CSS restrictions, hooks source, Visibility/Animation/Theme providers, debugger): ui-guide.md
tools
Develops resources for FiveM using vRP Creative Network with Lua. Covers Proxy/Tunnel system, Passport/Source/Datatable, inventory, money, groups, identity, database (oxmysql), events, and vRPEX compatibility. Use when the user works with vRP, Creative Network, vRPEX, Proxy, Tunnel, Passport, or any vRP server-side/client-side API.
development
Develops resources for FiveM using the Qbox Project (qbx_core). Covers the exports-based API, bridge compatibility, Ox integration (ox_lib, ox_inventory), and best practices. Use when the user works with FiveM, Qbox, qbx_core, or mentions `exports.qbx_core`, `QBX.PlayerData`, or `ox_lib`.
development
Develops resources for FiveM using the QBCore Framework. Covers resource creation, Core Object usage, Player management, Callbacks, Events, Items, Jobs, Gangs, Database (oxmysql), and best practices. Use when the user works with FiveM, QBCore, Lua scripts for QBCore servers, or mentions `QBCore.Functions`, `GetCoreObject`, `CitizenID`, or any system of the QBCore Framework.
tools
FiveM development best practices for any framework (vRP, QBCore, Qbox, ESX). Covers performance, security, client/server communication, cache (cacheaside), anti-exploit (cerberus), asset discovery, framework auto-detection, and dynamic documentation fetching. Use when the user works with FiveM, Lua scripts, natives, resources, fxmanifest, optimization, or general server development without a specific framework context.