Lua x React Boilerplate
A boilerplate for building FiveM UIs using React (TypeScript or JavaScript) and Lua. This template helps you quickly set up a modern UI for your FiveM scripts, with easy integration between Lua and Re
๐ Features
React Frontend โ Build UIs with React (choose TypeScript or JavaScript).
Lua Integration โ Communicate between your React UI and FiveM Lua scripts.
SCSS Support โ Style your UI with SCSS for advanced styling.
Hot Reload/Dev Server โ Fast development with live reloading.
๐ฆ Installation
Download the Boilerplate:
Visit the GitHub releases page.
Choose your preferred version: TypeScript or JavaScript.
Download and extract to your FiveM resources folder.
Add to
server.cfg
:ensure lua-react-boilerplate
โก Quick Start
Install dependencies:
cd web npm install
Build or run in dev mode:
Build for production:
npm run build
Or run the dev server for hot reload:
npm run dev
Create your own components:
Go to
web/src/components
and add your new component files.Import and use them in
App.tsx
(orApp.jsx
) inweb/src
to make them visible in your UI.
โ ๏ธ Troubleshooting
If you are having errors, make sure you are NOT running in npm run dev
mode. For FiveM to use your latest UI, always run npm run build
and use the built files.
๐ File Structure
lua-x-react-boilerplate/
โโโ fxmanifest.lua # Resource manifest
โโโ client/ # Lua client scripts
โโโ server/ # Lua server scripts
โโโ web/
โ โโโ src/
โ โ โโโ components/ # Your React components
โ โ โโโ App.tsx # Main React app (edit to add your components)
โ โโโ ...
โโโ README.md # Documentation
Last updated