COE UI // DESIGN SYSTEM UNIVERSAL · 5 TEMAS & SUPERFÍCIES ÓPTICAS

Rich interfaces without rebuilding the basics

coe_ui is the framework’s interface library: CSS tokens (--coe-*), ready-made components, 3D perspective callout.css, and a game bridge (theme_bridge.lua) that syncs theme and language in real time to any NUI.

CONVENIENCE STORE BuyManage

24/7 Strawberry

$ 340today
$ 2.2107 days
41sales
Water 4 in stock
Coffee 5 low
Cancel Save prices
Switch the theme — the interface follows:
01 // HOW IT WORKS

Three layers, one simple contract

All a NUI needs to know about coe_ui is CSS variables, .coe-* classes and a few messages. That is why it works with any front-end.

  1. 01 tokens.css

    Tokens

    --coe-* variables for color, surface, spacing, type, radius and motion. The 5 themes are :root[data-coe-theme] blocks.

  2. 02 components.css · components.js

    Components

    .coe-* classes (button, field, card, badge, modal) and the window.CoeUI API: confirm, t, translateDOM, setTheme.

  3. 03 theme_bridge.lua

    Game bridge

    Delivers theme, player accent and language to the page (coe:theme, coe:accent, coe:locale) and forwards every change in real time.

02 // CEF OPTICAL SURFACES · GLASS, CHAMFER & 3D CALLOUT

Zero Backdrop-Filter Bug, .coe-glass & callout.css

The framework’s devices and interfaces (coe_phone, coe_tablet, coe_deepweb, coe_hud, coe_mdt, and coetarget) share the same coe_ui optical foundation engineered specifically for FiveM’s CEF Chromium.

CEF CHROMIUM OPTICAL ARCHITECTURE

Safe Translucency & Spatial Callouts

  • Translucent Surface (.coe-glass & .coe-chamfer): Calibrated gradients over --coe-panel-rgb with 10px polygonal chamfers without triggering the transparent NUI black backdrop-filter bug.
  • 3D Diegetic Callouts (callout.css): .coe-reticle reticles and panels with perspective(700px) rotateY(-5deg) tilt used by coetarget and world interactions.
  • Automatic Bridge (theme_bridge.lua): Broadcasts the player’s KVP-saved theme and active coe_core locale to every NUI with zero idle CPU overhead.
coe_ui · Theme Bridge & CoeUI.confirm()
// Integração NUI pública com coe_ui (theme_bridge.lua + coe-ui.js)
window.addEventListener('coe:themeChanged', (ev) => {
  const { theme } = ev.detail; // "moss" | "ocean" | "amber" | "rose" | "violet"
  document.documentElement.setAttribute("data-coe-theme", theme);
});

async function dispatchTacticalUnit(incidentId, callsign) {
  const ok = await window.CoeUI.confirm({
    title: "Despachar Unidade Tática",
    message: `Confirmar empenho da viatura ${callsign} na ocorrência #${incidentId}?`,
    confirmText: "Confirmar Despacho",
    variant: "primary"
  });
  if (!ok) return;
  await fetch("https://coe_dispatch/assignUnit", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ incidentId, callsign })
  });
}
03 // STACK FREEDOM

Use whatever front‑end you like

The FiveM NUI is a full browser. coe_ui imposes no framework: plain HTML, React, Vue, Svelte, Tailwind, canvas or WebGL all read the same tokens and call the same API.

  • Themes switch on their own: variables change on :root and your component follows without a re-render.
  • Listen for coe:localeChanged on window to react to language changes in your state.
  • With a bundler (Vite, esbuild), output to html/ and list the files in files {}. No external CDNs.
  • In the FiveM NUI, backdrop-filter renders a black background: use .coe-glass for translucent panels.
html/index.html
<link rel="stylesheet" href="nui://coe_ui/html/tokens.css">
<link rel="stylesheet" href="nui://coe_ui/html/components.css">
<link rel="stylesheet" href="app.css">
<script src="nui://coe_ui/html/components.js"></script>

<button class="coe-button coe-button--primary" data-i18n="shop.buy"></button>
html/app.css
/* Your own CSS, tokens only */
.loot-card {
  background: var(--coe-panel);
  border: 1px solid var(--coe-line);
  padding: var(--coe-space-4);
}
.loot-card:hover {
  border-color: rgba(var(--coe-accent-rgb), 0.5);
}
04 // FOR DEVELOPERS

Less boilerplate, more time on the experience

Consistency for free

Inventory, HUD, shops, phone and tablet share one foundation. A new NUI starts out looking like the rest of the server.

Themes without rework

Switching the theme changes variables on :root. No component has to re-render or be rebuilt.

Languages built in

The dictionary arrives through the bridge; tag text with data-i18n or call CoeUI.t().

Accessible by default

Dialogs with ARIA, focus trapping and focus return; motion respects prefers-reduced-motion.

Tested in CI

jsdom DOM tests cover the dialog, theme, accent and NUI messages.

Zero build, zero dependencies

Static files served from nui://coe_ui/html/…. Nothing to install in the consuming resource.

05 // IN PRODUCTION

Framework interfaces built with CoE UI

06 // WHAT’S IN THE BOX

coe_ui files

tokens.css

Colors, surfaces, spacing, type and 5 themes.

components.css

.coe-button, .coe-field, .coe-card, .coe-badge, .coe-modal.

components.js

CoeUI.confirm() with focus trap, Esc/Enter and queueing; i18n via data-i18n.

surfaces.css

.coe-glass, .coe-chamfer and the .coe-reticle crosshair.

callout.css

Actions floating in 3D perspective over the crosshair.

panel.css · apps.css

Panels, slots and the base for phone and tablet apps.

prompt.css · prompt.js

Standard interaction prompt, driven by SendNUIMessage.

/coeui

In-game style guide with every component for visual review.

07 // GET STARTED

Two steps for your NUI

Declare the dependency and the bridge in the manifest and load the design system before your own CSS/JS. From then on, use only var(--coe-*) — no hard-coded colors — so it works across all 5 themes.

1 · fxmanifest.lua
dependencies { 'coe_core', 'coe_ui' }
ui_page 'html/index.html'
client_scripts { '@coe_ui/theme_bridge.lua', 'client.lua' }
files { 'html/index.html', 'html/app.css', 'html/app.js' }
2 · html/index.html
<link rel="stylesheet" href="nui://coe_ui/html/tokens.css">
<link rel="stylesheet" href="nui://coe_ui/html/components.css">
<link rel="stylesheet" href="app.css">
<script src="nui://coe_ui/html/components.js"></script>

<button class="coe-button coe-button--primary" data-i18n="shop.buy"></button>