Skip to content

Configuration ​

DevHUD accepts the following props to customize behavior and appearance.

Props Reference ​

PropTypeDefaultDescription
position"top-left" | "top-right" | "bottom-left" | "bottom-right""top-right"HUD overlay position
theme"light" | "dark""dark"Visual theme
trackNetworkbooleantrueEnable fetch (and optional axios) tracking
trackLongTasksbooleantrueEnable long-task monitoring
trackFPSbooleantrueEnable FPS sampling
sessionTimeoutnumber2000Inactivity timeout (ms) before session closes
forceEnabledbooleanfalseShow HUD regardless of NODE_ENV. Use for deployed demos.

Example ​

tsx
<DevHUD
  position="bottom-left"
  theme="light"
  trackNetwork={true}
  trackLongTasks={true}
  trackFPS={true}
  sessionTimeout={2500}
>
  <App />
</DevHUD>

Position ​

Controls where the HUD overlay appears. You can also change position at runtime using the corner icons in the panel header:

  • top-left
  • top-right
  • bottom-left
  • bottom-right

Theme ​

  • dark – Dark background, light text (default)
  • light – Light background, dark text

Tracker Toggles ​

Disable individual trackers to reduce overhead or focus on specific metrics:

tsx
<DevHUD
  trackNetwork={true}
  trackLongTasks={false}
  trackFPS={true}
>
  <App />
</DevHUD>

forceEnabled (Deployed Demos) ​

By default, the HUD is hidden in production (NODE_ENV === "production"). For deployed demos or previews where you want the HUD visible, pass forceEnabled:

tsx
<DevHUD forceEnabled>
  <App />
</DevHUD>

Use this only for demo/preview builds—do not enable in production apps serving end users.

Session Timeout ​

How long (in milliseconds) to wait after the last event before closing the current interaction session. Shorter values create more, shorter sessions; longer values group more activity into a single session.

tsx
<DevHUD sessionTimeout={5000}>
  <App />
</DevHUD>

TypeScript ​

Import the props type:

tsx
import { DevHUD, type DevHUDProps } from "react-performance-monitoring"