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

  1. Download the Boilerplate:

    • Choose your preferred version: TypeScript or JavaScript.

    • Download and extract to your FiveM resources folder.

  2. Add to server.cfg:

    ensure lua-react-boilerplate

โšก Quick Start

  1. Install dependencies:

  2. Build or run in dev mode:

    • Build for production:

    • Or run the dev server for hot reload:

  3. Create your own components:

    • Go to web/src/components and add your new component files.

    • Import and use them in App.tsx (or App.jsx) in web/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

Last updated