
现代界面 (s4_ui) – 为您的整个服务器提供统一的界面层
服务器上的所有通知、对话框、菜单和进度条 – 统一外观,统一API,零依赖。
直接放入即可,所有脚本使用相同的视觉语言。无需React运行时。无需数据库。无需框架锁定。如果您已经运行 ox_lib,s4_ui 可以渲染其 全部 界面,而无需触碰 ox_lib 或任何调用它的脚本。
ensure s4_ui
ensure ox_lib
为什么选择 s4_ui?
12个组件,一个导出API – 通知、菜单、对话框、技能检查、径向菜单等
ox_lib接管 – 一行代码即可重新设计整个服务器,无需修改
完全可定制和可重新定位 – 任何内容都不是硬编码的
通知和菜单中的Markdown – 粗体、代码、链接和列表
玩家UI编辑器 (/editui) – 玩家可以自定义自己的HUD,每个玩家保存设置
0.00ms空闲 – 无帧轮询,无数据库,独立运行
组件
| 组件 | 导出 | 返回 |
|---|---|---|
| 通知 | notify |
提示ID |
| 文本UI | textUI |
– |
| 进度条 | progress |
完成状态 (布尔值) |
| 圆形进度条 | circleProgress |
完成状态 (布尔值) |
| 技能检查 | skillCheck |
成功状态 (布尔值) |
| 警告对话框 | alert |
'确认' / '取消' / nil |
| 输入对话框 | input |
值数组 / nil |
| 上下文菜单 | context |
选择项 |
| 列表菜单 | menu |
{选中项, 值} |
| 径向菜单 | radial |
– |
| 复制板 | clipboard |
– |
| 缓存 (onCache风格) | getCache + 事件 |
值 |
所有内容均可定制和重新定位 – 任何内容都不是硬编码的。
ox_lib接管 – 两行代码即可重新设计整个服务器
确保 s4_ui 在 ox_lib 之前加载,并且所有 lib.notify、lib.progressBar、lib.showContext、lib.inputDialog、lib.skillCheck 等内容都以 s4_ui 渲染 – 无需修改 ox_lib 和调用它的脚本。
ensure s4_ui
ensure ox_lib
ox_lib中的其他内容 – 回调、区域、点、本地化、cache、数学和表格辅助功能 – 保持不变且继续工作。Font Awesome 图标名称会自动翻译为其 Boxicons 对应版本,以便现有脚本保留图标。每个模块可以在配置中单独交还给 ox_lib。
Markdown & 每次调用样式
文本字段渲染Markdown – 粗体、斜体、内联代码、链接、列表、标题和换行 – 在通知、Text UI、对话框和菜单中。
exports.s4_ui:notify({
title = 'Sale complete',
message = 'Sold **Sultan RS** for `$45,000`.',
})
notify、textUI 和 alert 还接受一个 style 表来重新设置单个调用,而无需触碰CSS – camelCase属性、直接数字作为像素、支持嵌套选择器:
exports.s4_ui:notify({
title = 'Custom',
message = 'One-off look.',
style = {
backgroundColor = '#141517',
color = '#f8f9fa',
borderRadius = 14,
['.description'] = { color = '#909296' },
},
})
开发者API
-- Blocking exports return their value directly - no callback wiring
local answer = exports.s4_ui:alert({ title = 'Confirm', message = 'Are you sure?' })
local ok = exports.s4_ui:skillCheck({ difficulty = 'medium', key = 'e' })
local values = exports.s4_ui:input({ title = 'Details', fields = { ... } })
- 菜单和径向菜单上的每个项目的
onSelect/onChange回调 - 与ox_lib兼容的字段名称 – 大多数代码片段无需修改即可迁移
- 客户端和服务器事件,用于跨资源触发
- Text UI窗口属于打开它的资源,因此另一个脚本的清理循环无法关闭您的提示
玩家UI编辑器
内置 /editui 命令。玩家可以在对齐网格上拖动、调整大小和定制每个元素,布局会使用FiveM KVP 在玩家自己的机器上按每个玩家保存。无需数据库,服务器端无需任何操作。
性能
| 空闲状态 | 0.00ms |
| 活跃状态 (通知/菜单打开) | 0.01ms |
| 线程 | 一个共享缓存轮询 (可配置,默认200ms) |
| 数据库 | 无需 |
| 框架 | Standalone |
| 构建 | Cerulean,Lua 5.4 |
UI层中没有每帧轮询循环。单个共享缓存线程取代了其他资源会自行运行的 while true / Wait(500) 循环。
预览 (使用接管功能)
🔔 Notifications

💬 Text UI
![图片[1]-[免费] [独立] 现代UI界面-Fivem论坛](https://forum-cfx-re.akamaized.net/original/5X/8/2/0/2/82021cead376f3a16bd8d6a55a6ff8f2d86e8b08.png)
![图片[2]-[免费] [独立] 现代UI界面-Fivem论坛](https://forum-cfx-re.akamaized.net/original/5X/d/f/2/a/df2aa6db1ae95bb88640477590c4e649e7d8fb5f.png)

⏳ Progress bar

⭕ Circular progress

🎯 Skill check

⚠️ Alert dialog

⌨️ Input dialog

📋 Context menu

📃 List menu

🎛️ Radial menu

🖐️ Player UI editor


配置
一个文件 – config/shared.lua:
- 主题颜色和暗/亮预设
- 角落半径、UI缩放、动画速度
- 字体和可选的UI声音钩子
- 组件默认值 (位置、持续时间、难度)
- 径向键绑定和编辑器命令
- ox_lib接管 – 全局开启或按模块开启
- Text UI所有权行为
安装
- 将
s4_ui放入您的resources/文件夹 - 在
server.cfg中添加ensure s4_ui,在它之前加载任何使用它的资源 - 启动服务器 – 您应该会看到:
[s4_ui] loaded - Modern UI by S4Development
正在使用ox_lib接管?
s4_ui必须在 ox_lib 之前加载。
链接
| s4development | |
| Docs | |
| YouTube |
| 代码可访问 | 否 |
| 基于订阅 | 否 |
| 代码行数(约) | ~5,200 |
| 需求与依赖 | 无需 (ox_lib可选) |
| 支持 | 是 |
查看英文原文 (Original)

Modern UI (s4_ui) – One clean interface layer for your entire server
Every notification, dialog, menu and progress bar on your server – one look, one API, zero dependencies.
Drop it in and every script speaks the same visual language. No React runtime. No database. No framework lock-in. And if you already run ox_lib, s4_ui can render its entire interface for you – without touching ox_lib or a single script calling it.
ensure s4_ui
ensure ox_lib
Why s4_ui?
12 components, one export API – notify, menus, dialogs, skill check, radial & more
ox_lib takeover – instant reskin of your whole server, no edits required
Fully themeable & repositionable – nothing is hardcoded
Markdown everywhere – bold, code, links & lists inside notifications and menus
Player UI editor (/editui) – players theme their own HUD, saved per player
0.00ms idle – no per-frame polling, no database, standalone
Components
| Component | Export | Returns |
|---|---|---|
| Notifications | notify |
toast id |
| Text UI | textUI |
– |
| Progress bar | progress |
completed (boolean) |
| Circular progress | circleProgress |
completed (boolean) |
| Skill check | skillCheck |
success (boolean) |
| Alert dialog | alert |
'confirm' / 'cancel' / nil |
| Input dialog | input |
array of values / nil |
| Context menu | context |
selection |
| List menu | menu |
{ selected, values } |
| Radial menu | radial |
– |
| Clipboard | clipboard |
– |
| Cache (onCache-style) | getCache + events |
value |
Everything is themeable and repositionable – nothing is hardcoded.
ox_lib takeover – reskin your whole server in two lines
Ensure s4_ui above ox_lib and every lib.notify, lib.progressBar, lib.showContext, lib.inputDialog, lib.skillCheck and the rest renders as s4_ui – no edits to ox_lib and no edits to the scripts calling it.
ensure s4_ui
ensure ox_lib
Everything else in ox_lib – callbacks, zones, points, locales, cache, math and table helpers – is untouched and keeps working. Font Awesome icon names are auto-translated to their Boxicons equivalent, so existing scripts keep their icons. Each module can be handed back to ox_lib individually in the config.
Markdown & per-call styling
Text fields render markdown – bold, italics, inline code, links, lists, headings and line breaks – in notifications, Text UI, dialogs and menus.
exports.s4_ui:notify({
title = 'Sale complete',
message = 'Sold **Sultan RS** for `$45,000`.',
})
notify, textUI and alert also take a style table to restyle a single call without touching CSS – camelCase properties, bare numbers as pixels, nested selectors supported:
exports.s4_ui:notify({
title = 'Custom',
message = 'One-off look.',
style = {
backgroundColor = '#141517',
color = '#f8f9fa',
borderRadius = 14,
['.description'] = { color = '#909296' },
},
})
Developer API
-- Blocking exports return their value directly - no callback wiring
local answer = exports.s4_ui:alert({ title = 'Confirm', message = 'Are you sure?' })
local ok = exports.s4_ui:skillCheck({ difficulty = 'medium', key = 'e' })
local values = exports.s4_ui:input({ title = 'Details', fields = { ... } })
- Per-item
onSelect/onChangecallbacks on menus and radials - ox_lib-compatible field names – most snippets port over unchanged
- Client and server events for cross-resource triggering
- The Text UI window belongs to the resource that opened it, so another script’s cleanup loop can’t close your prompt
Player UI editor
Built-in /editui command. Players drag, resize and theme every element on a snapping grid, and the layout is saved per player using FiveM KVP on their own machine. No database, nothing server-side.
Performance
| Idle | 0.00ms |
| Active (notification / menu open) | 0.01ms |
| Threads | One shared cache poll (configurable, default 200ms) |
| Database | Not required |
| Framework | Standalone |
| Build | Cerulean, Lua 5.4 |
There is no per-frame polling loop in the UI layer. The single shared cache thread replaces the while true / Wait(500) loops other resources would each run themselves.
Preview ( Takeover used )
🔔 Notifications

💬 Text UI
![图片[1]-[免费] [独立] 现代UI界面-Fivem论坛](https://forum-cfx-re.akamaized.net/original/5X/8/2/0/2/82021cead376f3a16bd8d6a55a6ff8f2d86e8b08.png)
![图片[2]-[免费] [独立] 现代UI界面-Fivem论坛](https://forum-cfx-re.akamaized.net/original/5X/d/f/2/a/df2aa6db1ae95bb88640477590c4e649e7d8fb5f.png)

⏳ Progress bar

⭕ Circular progress

🎯 Skill check

⚠️ Alert dialog

⌨️ Input dialog

📋 Context menu

📃 List menu

🎛️ Radial menu

🖐️ Player UI editor


Configuration
One file – config/shared.lua:
- Theme colours and dark/light presets
- Corner radius, UI scale, animation speed
- Fonts and optional UI sound hooks
- Component defaults (position, duration, difficulty)
- Radial keybind and editor command
- ox_lib takeover – on/off globally or per module
- Text UI ownership behaviour
Installation
- Drop
s4_uiinto yourresources/folder - Add
ensure s4_uitoserver.cfg, before any resource that uses it - Start the server – you should see:
[s4_ui] loaded - Modern UI by S4Development
Using the ox_lib takeover?
s4_uimust be ensured aboveox_lib.
Links
| s4development | |
| Docs | |
| YouTube |
| Code is accessible | No |
| Subscription-based | No |
| Lines (approximately) | ~5,200 |
| Requirements & dependencies | None (ox_lib optional) |
| Support | Yes |
本文资源搬运自 CFX.re FiveM 官方论坛,原作者:S4Development。原帖地址:https://forum.cfx.re/t/free-standalone-modern-ui-interface/5426235


![[插件按键对应编号][按键修改][键位查询]-Fivem论坛](http://f.sihuai.icu/wp-content/uploads/2026/03/d63f0844e220260306091608-scaled.png)

![[免费] WG Banking — 实体 ATM 屏幕显示,真实借记卡,完善的 SQL | QBox · QBCore · ESX-Fivem论坛](https://forum-cfx-re.akamaized.net/original/5X/5/5/e/a/55ea691f13ad0f2545afeec1ce334a806d08d20d.jpeg)
![[免费] 3D GPS 带状指示器 & 路标信标-Fivem论坛](https://f.sihuai.icu/wp-content/uploads/2026/10/f61e4aeda720261019215155-800x450.jpeg)
![[免费] 指纹扫描仪-Fivem论坛](https://forum-cfx-re.akamaized.net/original/5X/1/a/b/f/1abfb21417d58052e3af9a9a2c8a254821f2f058.jpeg)
![[ESX/QB-Core/Standalone] 传呼系统 (3D模型动画)-Fivem论坛](https://forum-cfx-re.akamaized.net/original/5X/b/0/0/d/b00db1803cc0f74ae22a17ac5c129d6be72b04f0.gif)

![[免费] Bob Mulet Luxury | MLO [免费]-Fivem论坛](https://forum-cfx-re.akamaized.net/original/5X/2/7/1/8/2718655d302d787f9ef4c36893d74d6812542b11.jpeg)

![[MLO] 车库与藏身处 [免费]-Fivem论坛](https://f.sihuai.icu/wp-content/uploads/2026/11/0fb3171ffa20261104203352-800x450.jpeg)
![[免费] Zyke’s 高级粉碎机 (FiveM, 同步, 自定义道具, 声音, 交互)-Fivem论坛](https://forum-cfx-re.akamaized.net/original/5X/b/e/0/a/be0a64b2a67ece57ad3e8230430b1333e174fdd7.gif)
![[免费] FiveM 狗狗散步脚本 | 狗狗散步工作与日托中心 | ESX, QBCore, QBX-Fivem论坛](https://forum-cfx-re.akamaized.net/original/5X/6/0/e/e/60ee47d4ad87758b0f288c94362e880253075aef.gif)
![[免费] 暂停菜单 | QBCore & Qbox | OchiDev-Fivem论坛](https://f.sihuai.icu/wp-content/uploads/2026/11/edd943b79820261104203632-800x424.jpeg)
![[免费] MZ Drugs Creator | 为 FiveM 定制的全功能药物系统-Fivem论坛](https://f.sihuai.icu/wp-content/uploads/2026/11/8e98e2799e20261104203651-800x450.jpeg)
![[免费] RD Fuel V1.0 – 拥有真实个性的加油站服务员-Fivem论坛](https://f.sihuai.icu/wp-content/uploads/2026/11/72a7e95eae20261104203755-800x450.jpeg)

暂无评论内容