OverflowOverflow
UI Library

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

  1. Drop of_ui into your resources folder.
  2. Add it to server.cfg:
ensure of_ui
  1. 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_lib

See 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

ComponentWhat it isBlocking
NotificationsToasts in a screen cornerNo
Text UIKey prompt pinned to a screen edgeNo
AlertConfirm / cancel dialogYes
InputForm dialog with validationYes
DrawerSide panel built from rowsOptional
Context menuMouse-driven menu treeNo
List menuKeyboard-driven side menuNo
Radial menuMouse wheel menuNo
ProgressTimed bar or circle, with anims and propsYes
Skill checkTiming minigameYes
ObjectivesMission timeline HUDNo

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:

  1. Download it from github.com/AMZAKU/ox_lib.
  2. Run it as your ox_lib. Replace your existing ox_lib resource with this fork, or install it instead of the upstream release.
  3. Restart the server, with of_ui starting before ox_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.

On this page