Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Components

Reusable UI components provided by dirk-cfx-react

All components are exported from dirk-cfx-react and use Mantine + Framer Motion internally. They follow a dark-theme, VH-based sizing convention.


Admin Components

AdminPageTitle

Section header for admin panel pages. Renders a Lucide icon with a localized uppercase title.

import { AdminPageTitle } from "dirk-cfx-react";
import { Fish } from "lucide-react";

<AdminPageTitle title="FishSettings" icon={Fish} color="#4ade80" />
Prop
Type
Description

title

string

Locale key for the title text

icon

ComponentType<LucideProps>

Lucide icon component

color

string

Icon colour

AsyncSaveButton

Animated save button with idle / pending / success / error states. Shows a spinner while saving, a check on success, and an X on failure.

import { AsyncSaveButton } from "dirk-cfx-react";

<AsyncSaveButton
  onSave={async () => {
    const result = await updateSettings(changes);
    return result;
  }}
  color="#4ade80"
  label="Save Changes"
/>
Prop
Type
Description

onSave

() => Promise<any>

Async save handler — return { success: false } to show error state

color

string

Theme colour for the button

label

string

Button label (default: "Save Changes")

style

CSSProperties

Optional inline styles


Input Components

InputContainer

Styled wrapper for form fields. Provides a title, description, error display, and consistent dark-theme styling.

Prop
Type
Description

title

string

Field label

description

string

Help text shown below the label

error

string

Validation error message

children

ReactNode

The input element(s)

w

string | number

Width (default: "100%")

flex

number | string

Flex value

bg

string

Background colour override

p

string | number

Padding (default: "sm")

rightSection

ReactNode

Content rendered to the right of the title

variants

Variants

Framer Motion variants

SelectItem

Item selector with image previews. Pulls items from the useItems store (populated by GET_ITEMS NUI callback).

Prop
Type
Description

label

string

Locale key for the select label

value

string

Currently selected item name

onChange

(value: string) => void

Change handler

excludeItemNames

string[]

Item names to exclude from the list

FiveMKeyBindInput

Compound component for configuring FiveM keybinds. Supports keyboard, mouse, gamepad, joystick, and touchpad input mappers.

Sub-components:

Component
Description

FiveMKeyBindInput (Root)

Context provider — requires value and onChange

FiveMKeyBindInput.Category

Dropdown to select the input mapper (keyboard, mouse, pad, etc.)

FiveMKeyBindInput.Key

Dropdown for the specific key — auto-filters to valid keys for the selected category


Modals

General-purpose modal with dark theme, header with icon/badge, close button, and description area.

Prop
Type
Description

title

string

Modal title

icon

React.ElementType

Header icon

iconColor

string

Icon colour

description

string

Description text below header

badge

{ label, color }

Optional badge next to the title

onClose

() => void

Close handler

width

string

Modal width (default: "52vh")

maxHeight

string

Max height (default: "85vh")

zIndex

number

Z-index (default: 100)

clickOutside

boolean

Close on backdrop click (default: true)

ConfirmModal

Destructive action confirmation with optional type-to-confirm.

Prop
Type
Description

title

string

Warning title

description

string

Warning message

confirmLabel

string

Confirm button text (default: "Delete")

confirmText

string

If set, user must type this exact string to enable confirm

onConfirm

() => void

Confirm handler

onClose

() => void

Cancel/close handler


Display Components

LevelBanner / LevelPanel

XP and level display components. Use with createSkill to define your levelling curve.

Counter

Animated number counter with configurable duration and format.

BorderedIcon

Icon with a bordered circular background, commonly used in lists.

FloatingParticles

Decorative animated particle effect for backgrounds.

InfoBox

Styled information box with icon and text.

Tab-style navigation bar with animated active indicator.

Title

Styled page title with gradient underline.

SegmentedControl / SegmentedProgress

Animated segmented controls and progress indicators.

Last updated