Skip to content

DebugOverlay

function DebugOverlay(__namedParameters): Element | null;

Floating debug HUD showing real-time rendering metrics.

Renders as an absolute-positioned overlay in a chosen corner of the screen. Displays current frame time, average, and optionally a per-phase breakdown and sparkline history — useful for profiling without leaving the application.

Respects the debug flag from render(element, { debug: true }). When debug mode is off, this component renders nothing — safe to leave in your tree unconditionally.

ParameterType
__namedParametersDebugOverlayProps

Element | null

import { DebugOverlay } from "@semos-labs/glyph";
function App() {
return (
<Box style={{ width: "100%", height: "100%" }}>
<MyContent />
<DebugOverlay />
</Box>
);
}

PropertyTypeDescription
phases?booleanShow per-phase breakdown (layout / paint / diff / swap). Defaults to true.
position?"top-right" | "top-left" | "bottom-right" | "bottom-left"Corner to anchor the overlay. Defaults to "top-right".
sparkline?booleanShow sparkline graph of recent frame times. Defaults to true.
style?StyleOverride the default overlay style. Merged on top of the base style.