Installation
OF_UI is a UI library for FiveM that any resource on your server can call through exports.
Every component is themeable from one settings menu, and the whole theme travels as a single short code you can paste into another server.
Installation
- Drop
of_uiinto yourresourcesfolder. - Add it to
server.cfg:
ensure of_ui- Restart the server. Every component is now available to every resource.
If you also run ox_lib, start of_ui first.
ensure of_ui
ensure ox_libSee ox_lib integration for more information.
Calling a component
Every component is an export on of_ui:
exports.of_ui:notify({
type = 'success',
title = 'Vehicle stored',
description = 'Sultan RS, Legion garage',
})Some components block until the player answers. Those must run inside a thread, or they freeze the one that called them:
CreateThread(function()
local answer = exports.of_ui:alert({
header = 'Sell vehicle',
content = 'Sell this vehicle for **$12,500**?',
cancel = true,
})
if answer == 'confirm' then
-- ...
end
end)The blocking components are alert, input, drawer, progress and skill check. Every other export returns immediately.
Components
| Component | What it is | Blocking |
|---|---|---|
| Notifications | Toasts in a screen corner | No |
| Text UI | Key prompt pinned to a screen edge | No |
| Alert | Confirm / cancel dialog | Yes |
| Input | Form dialog with validation | Yes |
| Drawer | Side panel built from rows | Optional |
| Context menu | Mouse-driven menu tree | No |
| List menu | Keyboard-driven side menu | No |
| Radial menu | Mouse wheel menu | No |
| Progress | Timed bar or circle, with anims and props | Yes |
| Skill check | Timing minigame | Yes |
| Objectives | Mission timeline HUD | No |
Input dialogs and drawers share one row model. See Rows for every row type they both accept.
Integration: ox_lib
OF_UI is standalone: nothing about it requires ox_lib, and the exports above work on their own.
This uses a maintained fork of ox_lib with the of_ui integration built in:
- Download it from github.com/AMZAKU/ox_lib.
- Run it as your
ox_lib. Replace your existingox_libresource with this fork, or install it instead of the upstream release. - Restart the server, with
of_uistarting beforeox_lib.
Download: ox_lib fork
Theming
Every colour, radius, blur and duration is a token. Players open the settings menu with /themesettings, and a whole theme exports as one code you can pin as the server default or lock down token by token.
See Theming.
