lation ui
lation ui is a UI library for FiveM that gives your scripts notifications, menus, dialogs, a progress bar, minigames and more through client exports, styled from one theme your admins edit in game.
lation ui (lation_ui) is the interface your other scripts call. It gives them thirteen components through client exports: notifications, a context menu, a list menu, a radial menu, alert and input dialogs, a progress bar, text UI, a timeline, a drawer, and three minigames (skill check, signal breach and pattern lock). Admins restyle all of it in game with the theme editor, players can keep a theme of their own if you allow it, and lation interact, lation banking, lation shops and lation jobs follow the same theme.
Works on Qbox, QBCore and ESX, and on servers with no framework: lation ui doesn't call one.
Requirements
| Resource | Needed | What for |
|---|---|---|
| A FiveM server | Required | The resource is fx_version 'cerulean', game 'gta5', Lua 5.4 |
| A framework | No | lation ui calls no framework |
ox_lib | No | Only the lation ox_lib fork, if you want scripts written for ox_lib to show lation ui |
oxmysql or a database | No | There are no tables. The server theme is a JSON file inside the resource, and personal themes are kept on each player's client. |
| Players reaching Google Fonts | Optional | Only for the 18 theme fonts that aren't bundled. Inter and JetBrains Mono ship with the resource. |
Install
Follow the install guide, then:
Keep the folder name lation_ui. A renamed folder prints an error on start and again every 15 minutes, and scripts that call exports.lation_ui won't find it.
Ensure it first, above ox_lib and every script that uses it. The lation ox_lib fork (step 5) looks for lation ui when ox_lib starts, so lation ui has to be running by then:
ensure lation_ui
ensure ox_lib # if you run it
# scripts that call exports.lation_ui go below
ensure my_scriptLet your admins edit the server theme. /uitheme checks the ACE permission lation_ui.admin:
add_ace group.admin lation_ui.admin allowOptional: let players keep a theme of their own with /uisettings:
setr lation_ui:allowUserThemes 1Optional, but recommended: replace your ox_lib with the lation ox_lib fork. It sends ox_lib's notifications, menus, dialogs, progress bars, skill checks and text UI to lation ui, so scripts written for ox_lib show in your theme with no code changes. The fork keeps the resource name ox_lib, so put it in place of your ox_lib folder and leave ensure ox_lib where it is, below ensure lation_ui.
Restart the server.
There is no SQL to import and nothing to add to a framework. Every option and convar is on the configuration page.
Upgrading from 1.x
The old init.lua ox_lib bridge was removed in 2.0. A script that still loads @lation_ui/init.lua must switch to the lation ox_lib fork or call the exports directly. Every export, event and payload from 1.x works unchanged.
When you update, copy the new files over the old folder. The server theme lives in data/theme.json, which isn't part of the download, so it stays. If you delete the folder first, keep a copy of data/theme.json and put it back afterwards.
First start
On start, lation ui loads the server theme from data/theme.json. On a fresh install there is no file yet, so the built-in theme is used. When Config.version is on, it also checks for a newer version and prints a notice in the console only when one is out. Players see nothing until a script calls an export.
Check it works. Run this from any client script:
exports.lation_ui:notify({
title = 'Success',
message = 'It works!',
type = 'success'
})
In game, run /uitheme as an admin to set your server's look. Pick a preset, change the colors, corners and font, and press Save. Every player sees it at once. The theming page covers the editor.
Point your scripts at it: call the exports from your own scripts (start with shared options), or run the ox_lib fork below for scripts written for ox_lib.
Using it with ox_lib scripts
The lation ox_lib fork forwards lib.* interface calls to lation ui, so scripts written for ox_lib show lation ui components without code changes. Run it in place of ox_lib, with ensure lation_ui above ensure ox_lib. Scripts that don't use ox_lib call the exports directly.
lation ui also takes ox_lib-shaped data where it can: description and the inform type in notifications, option tables keyed by title in context menus, a bare list of fields in input dialogs, and a list menu shaped like lib.registerMenu.
Troubleshooting
The console says to rename the folder
The resource folder isn't called lation_ui. The console prints an error naming the folder and Please rename the folder to 'lation_ui' to avoid further issues, on start and every 15 minutes after. Rename the folder and restart.
A script errors with No such export
The script called exports.lation_ui before lation ui started, or lation ui isn't running. Put ensure lation_ui above that script in server.cfg.
The console says Unable to fetch version information from API
The version check couldn't reach the update server. Nothing else is affected. Set Config.version = false in config.lua to turn the check off.
The console says data/theme.json is not valid JSON
The saved server theme was edited by hand and broken, so lation ui ignored it and used the built-in theme. Fix the JSON, or delete the file and save a new theme with /uitheme.
/uitheme says I don't have permission
Your player doesn't have the ACE permission lation_ui.admin. Add add_ace group.admin lation_ui.admin allow (or your own group) to server.cfg and make sure your player is in that group. The server checks it again on every save and reset.
/uisettings says theme customization is disabled
Personal themes are off. Set setr lation_ui:allowUserThemes 1. Players already connected pick it up when they next join, or the next time an admin saves or resets the server theme.
Next steps
Theming
The theme editor, presets, share codes, personal themes and the theme format.
Configuration
config.lua, convars, language, permissions, commands and key bindings.
Shared options
Icons, colors, text formatting and positions every component uses.
Notifications
The notify export and the event to send one from the server.
Context menu
Clickable menus with submenus, metadata, progress bars and keybinds.
Minigames
Skill check, signal breach and pattern lock.
Still stuck? Ask in our Discord: the people who write the scripts answer.
Last updated
Choosing a FiveM framework
Qbox, QBCore and ESX, the three main FiveM frameworks, compared on usage, performance and completeness, and which one to start a new server on.
Theming
How lation ui themes stack, how admins and players use the in-game theme editor, its presets and share codes, the theme format, and the theme exports and event.