Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A Next.js 14 boilerplate for FiveM NUI interfaces with TypeScript, Tailwind CSS, Redux Toolkit, and DaisyUI.
The FiveM NUI NextJS Boilerplate is a GitHub template that scaffolds a Next.js 14 front-end for FiveM NUI (New User Interface) resources, wiring a TypeScript React UI to Lua server/client code through Redux Toolkit and NUI callbacks.
The FiveM NUI NextJS Boilerplate is a starting point for building in-game interfaces for FiveM servers using a separate Next.js UI deployed independently from the Lua resource. It takes a standard FiveM resource structure (fxmanifest.lua, config.lua, client.lua, server.lua) and a Next.js application in the ui folder, and produces a working NUI menu that opens with a hotkey and exchanges data with the game via NUI messages and callbacks. The template is created by OMikkel and is publicly available as a GitHub template repository, making it easy to generate a new repository with the "Use this template" button.
app/page.tsx structure) for server-rendered or static UI.ui_page URL in fxmanifest.lua points to the deployment.The template establishes a two-way data flow between the Next.js UI and the FiveM Lua resource. From the client, SendNUIMessage sends an object with a type matching a Redux slice/reducer name and a data payload, which the UI reducer applies to its state. In the reverse direction, the UI calls a NUI callback like getPlayerCount, which the client registers via RegisterNUICallback; the client then asks the server for data and returns it through the callback. The README includes copy-paste examples for both client.lua and server.lua.
To get started, clone the repository, add the resource to your server, install the UI dependencies, build and start the project, then update the ui_page URL in fxmanifest.lua. If you rename the fivem-nextjs-example folder, update the NEXT_PUBLIC_RESOURCE_NAME environment variable in the ui/.env file, and add that same variable in the Vercel dashboard when deploying there.
If you change the fivem-nextjs-example folder name, update the NEXT_PUBLIC_RESOURCE_NAME variable in the ui/.env file. When deploying on Vercel, set the same environment variable in your Vercel project settings.
The default hotkey is H. You can press it in-game to open the menu once the resource is ensured on the server.
Yes, the entire UI is written in TypeScript, and the template includes type-safe examples for Redux reducers and NUI callback handling.
Yes, the README provides step-by-step instructions for Vercel deployment, including creating a new repository from the template, connecting it to Vercel, adding environment variables, and updating the ui_page URL.
