Getting Started
Dirk CFX React
Installation
Install dirk-cfx-react in your resource's web/ folder:
Wrap Your App
In your resource's root React component, wrap everything in DirkProvider:
DirkProvider handles:
- Mantine theme setup with dark mode and VH-based sizing
- Fetching server settings (currency, colours, item image path, game type)
- Font loading (Akrobat family)
- Error boundary wrapping
- NUI ready signal (
NUI_READYcallback)
Build Setup
Your resource's web/ folder should use Vite as the build tool. A typical Vite config:
Build command:
The output goes to web/build/ which is served by FiveM's NUI system.
Importing
Everything is exported from the top-level package:
You can also import from sub-paths if you prefer:
Was this page helpful?
This page was last updated on 15 March 2026