FiveM NUI Design: Building Modern Interfaces with Vue 3 & Vite (2026)
Everything you need to know about creating premium FiveM NUI interfaces using Vue 3 and Vite — from project setup to production builds. Learn the patterns used in top-tier scripts like Alone Imposter.
The Evolution of FiveM NUI
FiveM NUI (New User Interface) has evolved dramatically. In the early days, scripts used plain HTML with inline styles and jQuery. Then came Bootstrap templates and basic React/Vue setups. In 2026, the standard for premium scripts is Vue 3 with Vite — and for good reason.
Why Vue 3 + Vite for FiveM NUI
Vue 3 Advantages
| Feature | Benefit for FiveM |
|---|---|
| Composition API | Clean logic organization for complex UIs like game lobbies |
| Reactive system | UI updates automatically when game state changes — no manual DOM manipulation |
| Component system | Reusable player cards, buttons, modals — build once, use everywhere |
| Transition system | Built-in animations for screen transitions (lobby → game → result) |
| Small runtime | Vue 3 is ~16KB gzipped — minimal memory overhead in the FiveM browser |
| TypeScript support | Catch type errors before runtime — fewer bugs in production |
Vite Advantages
| Feature | Benefit for FiveM |
|---|---|
| Instant HMR | Hot module replacement — see UI changes without restarting the resource |
| Tree shaking | Dead code elimination — only include what you use |
| Fast builds | Production builds in seconds, not minutes |
| Modern output | ES module output optimized for modern browsers |
| Plugin ecosystem | PostCSS, SCSS, SVG components, auto-imports |
Together, Vue 3 + Vite produce a NUI that is fast to develop, fast to build, and lightweight at runtime.
Project Structure for FiveM NUI
A well-organized Vue 3 NUI project inside a FiveM resource looks like this:
resource-folder/
├── client/
│ └── main.lua -- Client-side game logic
├── server/
│ └── main.lua -- Server-side game logic
├── config.lua -- Shared configuration
├── html/ -- Production NUI build output(DO NOT EDIT)
│ ├── index.html
│ └── assets/
│ ├── index-[hash].js
│ └── index-[hash].css
├── web/ -- NUI source code
│ ├── src/
│ │ ├── App.vue
│ │ ├── main.ts
│ │ ├── components/
│ │ ├── composables/
│ │ └── types/
│ ├── index.html
│ ├── vite.config.ts
│ ├── package.json
│ └── tsconfig.json
└── fxmanifest.lua
The key separation: web/ contains the source code you edit, and html/ contains the compiled output that FiveM serves to the player. The build process writes from web/ to html/.
Communication Between NUI and Lua
The bridge between your Vue 3 UI and the game logic happens through two mechanisms:
Lua → NUI (Sending Data)
-- Client-side Lua
SendNUIMessage({
type = 'gameStateUpdate039;,
state = 'voting039;,
players = playerList,
timeRemaining = 30
})
NUI → Lua (Receiving Actions)
class="hl-comment">// Vue class="hl-number">3 component
async function castVote(targetId: number) {
await fetch(class="hl-string">https:class="hl-comment">//${resourceName}/castVote, {
method: &class="hl-comment">#class="hl-number">039;POSTclass="hl-number">039;,
body: JSON.stringify({ target: targetId })
});
}
Listening in Vue
class="hl-comment">// In a Vue composable or onMounted
window.addEventListener(&class="hl-comment">#class="hl-number">039;messageclass="hl-number">039;, (event) => {
const { type, ...data } = event.data;
switch (type) {
case &class="hl-comment">#class="hl-number">039;gameStateUpdateclass="hl-number">039;:
gameState.value = data.state;
players.value = data.players;
break;
case &class="hl-comment">#class="hl-number">039;roleRevealclass="hl-number">039;:
isImpostor.value = data.isImpostor;
break;
}
});
Designing for FiveM: Key Principles
1. Respect the Game View
FiveM UIs overlay the game world. Your NUI should not completely obscure the game unless it is a full-screen moment (like a role reveal). Use transparency, blur backgrounds, and compact layouts.
2. Speed Matters
Players need to react quickly. Voting buttons should be large and clearly labeled. Animations should be smooth but fast — no 2-second fade-ins for a vote button.
3. Dark Theme by Default
GTA V is played in all lighting conditions. A dark-themed NUI with high-contrast text works best because it does not blind the player or clash with the game's visuals.
4. Mobile-Friendly Patterns (Sort Of)
While FiveM runs on desktop, many of the design patterns from mobile UI work well — large touch targets translate to easy-to-click buttons, clear visual hierarchy, and minimal clutter.
Building the NUI for Production
When you are ready to deploy, build the NUI:
cd web
npm install
npm run build
This compiles everything into the html/ folder. The built files are what FiveM serves to the player.
Important Rules
- Never edit files in
html/assets/— They will be overwritten by the next build - Keep
web/as the source of truth — All changes happen here - Version control
web/, nothtml/— The build output is derived
Pre-Built Delivery
Many premium scripts — including Alone Imposter — ship with the NUI pre-built. This means server owners can deploy immediately without needing Node.js on their production server. Developers who want to customize can rebuild from the web/ folder.
Real-World Example: Alone Imposter NUI
Alone Imposter demonstrates what a well-built Vue 3 NUI looks like in production:
- Mugshot player cards — Each player shown with their character face capture
- State-driven screens — The UI automatically transitions between lobby, reveal, discussion, voting, and result
- Smooth animations — Vue 3 transitions between screens with fade and slide effects
- Responsive voting — Large vote buttons with real-time tally updates
- Compact design — Does not obscure the game world during discussion phases
- Bilingual — Language switching (English/Spanish) built into the component system
The end result is a NUI that feels native to GTA V while being built with modern web technology.
Conclusion
Vue 3 + Vite is the gold standard for FiveM NUI development in 2026. If you are building scripts that need polished interfaces — minigames, admin panels, interactive systems — this stack delivers the best developer experience and the best player experience.
For a production example of what this stack can deliver, check out Alone Imposter — a social deduction minigame with a premium Vue 3 NUI.
→ See Alone Imposter in Action
Interested in NUI development tips? Join the Alone Studios Discord.
Ready to Add Social Deduction to Your Server?
Alone Imposter delivers everything discussed in this article — proximity lobbies, mugshot player cards, voting system, Vue 3 NUI. QBCore, ESX & QBOX.
Get Alone Imposter on Tebex