Kura UI
Shared NUI overlay layer for Kura resources, starting with reusable controls hints.
Kura UI is the shared interface layer for the Kura ecosystem. It currently ships:
- one always-loaded NUI application
- a shared overlay registry so multiple resources can render at the same time
- a reusable controls overlay for hints like
ESC Back - client ownership tracking and cleanup on resource stop
- server relay helpers for target-player HUD overlays
Current scope
kura-ui is intentionally small right now. The shared overlay foundation is already in place, but the first shipped feature is kura.ui.controls.
Recommended style
For Kura-native resources, prefer the kura.ui global through @kura-core/init.lua.
local ui <const> = kura.ui
if not ui then
return
end
ui.controls.show({
id = 'garage:navigation',
anchor = 'bottom-right',
items = {
{ input = 'ESC', label = 'Back' },
{ input = 'ENTER', label = 'Select' },
},
})That is the recommended default for normal Kura UI usage:
kura.uifor Kura-native resources- stable ids for overlays you need to update later
anchorplusoffsetfor layout- server relay only for player-targeted HUD overlays
- multiple resources rendered together instead of singleton UI ownership
Download Kura UI
- Get the latest release from GitHub
- Extract it into your server's
resourcesdirectory - Ensure the folder is named
kura-ui
Configure your server
For Kura-native servers, use this start order:
ensure kura-lib
ensure kuradb
ensure kura-ui
ensure kura-coreThen add ensure kura-ui to your server.cfg if it is not already in your base startup list.
Boots before kura-core
kura-ui can start before kura-core. kura-core attaches the shared kura.ui namespace later, while kura-ui still exposes its own export surface immediately.
Add to your resource
Add to your fxmanifest.lua:
shared_scripts {
'@kura-core/init.lua',
}That gives your resource access to kura.ui.
For resources that cannot assume the kura global exists yet, use the export surface instead:
local ui = exports['kura-ui']:getInterface()That returns the same namespaced API.
Editor setup
For LuaLS, add kura-ui to your workspace library paths once. Kura source checkouts can use:
{
"Lua.runtime.version": "Lua 5.4",
"Lua.diagnostics.globals": ["kura"],
"Lua.workspace.checkThirdParty": false,
"Lua.workspace.library": [
"./kura-core",
"./kura-lib",
"./kura-ui",
"./db/kuradb/lib"
]
}Overlay model
kura-ui does not treat HUD elements as singletons.
Each resource can register its own overlay nodes, and Kura UI:
- tracks ownership per resource
- stacks overlays in the same anchor instead of replacing them
- clears a resource's overlays automatically when that resource stops
- keeps client-owned overlays and server-relayed overlays separate internally
That is what allows a future confirmation modal and a controls hint set to exist together without conflicting.
Your first controls overlay
local ui <const> = kura.ui
if not ui then
return
end
local controlsId = ui.controls.show({
id = 'inventory:controls',
anchor = 'bottom-right',
items = {
{ input = 'ESC', label = 'Close' },
{ input = 'TAB', label = 'Move focus' },
},
})
ui.controls.update(controlsId, {
items = {
{ input = 'ESC', label = 'Back' },
{ input = 'ENTER', label = 'Confirm' },
},
})Server relay example
Use the server surface when you want to show HUD controls for one or more target players:
local ui <const> = kura.ui
local id = ui.controls.showFor(source, {
id = 'confirm:controls',
anchor = 'bottom-right',
items = {
{ input = 'ESC', label = 'Cancel' },
{ input = 'ENTER', label = 'Confirm' },
},
})
ui.controls.hideFor(source, id)Kura architecture note
Use kura-ui directly for reusable presentation primitives and shared framework UI.
For gameplay systems such as inventory, menus, shops, garages, or character creation, prefer higher-level Kura APIs when they exist. Those APIs can compose shared UI behavior, input routing, validation, and state flow on top of the base overlay layer.
What's next
- Controls — The full
kura.ui.controlsAPI, anchors, updates, and server relay usage