FreeScript
zedlib
by atoshit · version 1.3.0 · updated 2 days ago
No reviews yet
- Downloads
- 0
- Reviews
- 0
- Size
- 151 KB
- Code check
- Clean
- Licence
- MIT
- Released
- Nov 2026
Zed Library is a comprehensive library built for FiveM, designed to help developers easily create modern, responsive, and high-performance user interfaces direc
ZedLib - Modern FiveM UI Library
A production-ready, modular UI library for FiveM featuring a React-based NUI frontend and a clean Lua API. Build beautiful menus, notifications, and dialogs with minimal code.
Table of Contents
Layer, Technology
Frontend, React 19, TypeScript (strict), Vite 6
State, Zustand 5
Styling, TailwindCSS 3
Animation, Framer Motion 11
Backend, FiveM Lua (client-side)
Installation1. Build the UI
2. Add to your FiveM server
Copy the
3. Set up your resource
Option A — Import file (recommended)
Add zedlib as a dependency and include
You can then use the
Option B — Exports
Add zedlib as a dependency and call functions through FiveM exports. No extra file needed:
You can then call any function via
…
A production-ready, modular UI library for FiveM featuring a React-based NUI frontend and a clean Lua API. Build beautiful menus, notifications, and dialogs with minimal code.
Table of Contents
- Features
- Tech Stack
- Installation
- Usage Methods
- Usage
- Menus
- Context Menu
- Progress Bar
- Interact
- Notifications
- Dialogs
- Configuration
- Keyboard and Mouse Navigation
- Full API Reference
- Complete Example
- Development
- Project Structure
- License
- Fully navigable menus with keyboard and mouse wheel
- Description option on all items (button, checkbox, list, slider, submenu, category, search, info, separator): when set, a panel below the menu shows that text for the focused item
- Button, checkbox, list selector, slider, separator, submenu, category, and info items
- Categories: expand/collapse groups of items in-place (e.g. "Actions on player" → Freeze, Kick, Ban); items can be assigned to a category and only show when it is expanded
- Info button: hover or focus to show a side panel with label/value pairs (e.g. player name, group, job)
- Search/filter functionality for large menus
- Submenu stack navigation with back support
- Custom accent colors and banner images (default accent: red)
- Icon support (FontAwesome names or image URLs)
- Optional category on any item so it appears only when that category is expanded
- Four notification types: success, error, warning, info
- Optional custom accent color per notification
- Configurable display duration
- Optional body message and icon
- Bulk clear support
- Black background with colored accent bar and icon badge
- Input dialogs with field types: text, number, password, textarea
- Optional accent color and header icon per dialog
- Confirm/cancel dialogs with one-liner shortcut (with optional color)
- Customizable buttons with primary, secondary, danger variants and optional icon
- Field validation (required, maxLength, min/max)
- Closable toggle
- Default accent color: red when not specified
- Entity targeting with ALT key: hold ALT to show cursor, left-click an entity to open context menu
- Entity highlighting: targeted entities become semi-transparent for visual feedback
- Camera lock: camera is locked while ALT is held, movement (WASD) remains active
- Release ALT to close: releasing ALT closes everything instantly
- Flyout submenus: submenus expand to the right on hover (nested submenus supported)
- Shine hover effect: items glow with red accent border on hover, consistent with the menu system
- Register options by entity type:
vehicle,ped,player,object,myself,mycar, orall - Target yourself:
myselftype for options on your own character - Target your vehicle:
mycartype for options on the vehicle you are sitting in (inheritsvehicleoptions) - Target a specific entity:
entityfield to bind options to a single entity handle - Target by model/prop:
modelfield to bind options to all props of a given model name or hash - Auto-cleanup: options are automatically removed when the resource that registered them stops
- Interaction prompt at world coordinates (above peds, doors, etc.)
- Optional key (e.g.
E) displayed in a small box on the left; omitkeyto show only the label - Key press animation on the key box when the player presses the key
- Dynamic coords: pass a function for moving entities (e.g. ped head)
- Distance-based visibility and
onSelectcallback
- Same as Interact but hold the key for a
duration(ms) - Progress bar below the label while holding;
onSelectonly when full duration complete - onCancel when the player releases early or leaves range
- Blocking function: returns
true(completed) orfalse(cancelled) - Animation support: play animations during the progress (dict + clip)
- Prop attachment: attach props to the player (model, position, rotation, bone)
- Cancel support: optional ESC/Backspace cancellation
- Control disabling: selectively disable movement, vehicle, combat, or mouse controls
- Uses the global accent color with glow effect
- UI sound effects (hover, select, toggle) with global toggle
- Smooth animations and hover shine effects
- Plugin system for extensibility
- Hot reload dev playground (no FiveM required)
- Optimized production build
- Lua API split by component:
lua/api/(menu, notification, dialog, progressbar, context, config, exports)
Layer, Technology
Frontend, React 19, TypeScript (strict), Vite 6
State, Zustand 5
Styling, TailwindCSS 3
Animation, Framer Motion 11
Backend, FiveM Lua (client-side)
Installation1. Build the UI
cd zedlib/web
npm install
npm run build2. Add to your FiveM server
Copy the
zedlib folder into your server's resources/ directory, then add it to your server.cfg:
ensure zedlib3. Set up your resource
Option A — Import file (recommended)
Add zedlib as a dependency and include
import.lua in your fxmanifest.lua. This gives you the zed.* API with automatic cross-resource callback support:
fx_version 'cerulean'
game 'gta5'
dependencies { 'zedlib' }
shared_scripts {
'@zedlib/import.lua',
}
client_scripts {
'client.lua',
}You can then use the
zed.* namespace in your scripts:
zed.CreateMenu("my_menu", "My Menu")Option B — Exports
Add zedlib as a dependency and call functions through FiveM exports. No extra file needed:
fx_version 'cerulean'
game 'gta5'
dependencies { 'zedlib' }
client_scripts {
'client.lua',
}You can then call any function via
exports.zedlib:
exports.zedlib:CreateMenu("my_menu", "My Menu")…