WRAPCODERS

GTA 5 Roleplay Game HUD

Component

About

Production-ready GTA 5 and FiveM roleplay heads-up display component featuring tactical GPS vector radar, interactive activities and dispatch hub, automotive speedometer, voice status, and real-time communications.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds GTA 5 Roleplay Game HUD to your project and fits it to your theme.

Code

How GTA 5 Roleplay Game HUD is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { useEffect } from "react";
import GtaRoleplayHud from "@/components/ui/gta-roleplay-hud";

const CITY_NIGHT_BACKDROP =
  "https://cdn.21st.dev/assets/mirror/2e/2e9552f7475f8524118c3ed7e94a254bd0a60e2b0757ee7cc605c0af3427609e.jpg";

const settings = {
  serverName: "LOS SANTOS RP",
  onlineCount: 745,
  wantedStars: 3,
  healthPercent: 85,
  armorPercent: 60,
  speed: 89,
  fuelPercent: 68,
  showBackdrop: true,
};

export default function GtaRoleplayHudDemo(props: Partial<typeof settings>) {
  const s = { ...settings, ...props };

  useEffect(() => {
    if (typeof window === "undefined") return;
    const themeParam = new URLSearchParams(window.location.search).get("theme");
    if (themeParam === "light") {
      document.documentElement.classList.remove("dark");
    } else if (themeParam === "dark") {
      document.documentElement.classList.add("dark");
    }
  }, []);

  return (
    <div className="min-h-screen w-full bg-background text-foreground p-2 sm:p-4 flex items-center justify-center">
      <div className="w-full max-w-7xl">
        <GtaRoleplayHud
          serverName={s.serverName}
          onlineCount={s.onlineCount}
          serverRegion="US-EAST"
          wantedStars={s.wantedStars}
          healthPercent={s.healthPercent}
          armorPercent={s.armorPercent}
          telemetry={{
            speed: s.speed,
            maxSpeed: 240,
            gear: s.speed > 110 ? 5 : s.speed > 60 ? 4 : 2,
            fuelPercent: s.fuelPercent,
            odometer: 96282,
            turnSignal: "none",
          }}
          backgroundImageUrl={CITY_NIGHT_BACKDROP}
          showBackdrop={s.showBackdrop}
        />
      </div>
    </div>
  );
}

Dependencies

More by WRAPCODERS

View all
  • Product Hover Showcase

    Product Hover Showcase

    89
  • Real Estate 3D Hero

    Real Estate 3D Hero

    50
  • Metric Trend Chart

    Metric Trend Chart

    35
  • LoopAI CRM

    LoopAI CRM

    32
  • Flash Technologies Crypto Wallet Hero

    Flash Technologies Crypto Wallet Hero

    23
  • AI Motion Visual Orb

    AI Motion Visual Orb

    21
  • TraceRocket Reports Dashboard

    TraceRocket Reports Dashboard

    20
  • Client Management CRM Hub

    Client Management CRM Hub

    19

Explore more

Part of Components — browse the full library on 21st.dev.