Crosshair Cursor

PRONew

Preview live, install via shadcn or copy the source.

Installation

Install via shadcn

This will install the component and its dependencies automatically.

PRO COMPONENT

Unlock with PRO

This component is exclusive to reframe/ui PRO.
Get instant access to all premium components and templates.

Usage

crosshair-cursor-usage.tsxTSX

Props

NameTypeDefaultRequiredDescription
colorstringwhiteNoLine color. Applies to CrosshairCursor (global) and CrosshairCursorArea (bounded).
lineWidthnumber1NoLine width in px.
dotColorstringNoCenter dot color (defaults to color).
dotSizenumber6NoCenter dot diameter in px.
gapnumber7NoGap around dot where lines break (px).
showCoordinatesbooleantrueNoShow X/Y coordinate labels on the axes.
coordinateMode"px" | "percentage" | "both"pxNoCoordinate formatting mode.
showDotbooleantrueNoShow center dot.
zIndexnumber50NoZ-index for overlay (Area defaults to 20).
hideNativeCursorbooleanfalseNoHide native cursor when active. Area defaults to true (cursor-none inside).
smoothnumber0.18NoSmooth follow factor 0–1 (0 = instant).
disableOnTouchbooleantrueNoDisable on coarse pointers (touch).
containerRefReact.RefObject<HTMLElement | null>NoOptional bounding container ref for CrosshairCursor – axes clip to its rect.
containerSelectorstringNoSelector for bounding container (alternative to ref) for CrosshairCursor.
stickToEdgebooleantrueNoWhen bounded, clamp to closest edge when cursor is outside.
hideOnLeavebooleantrueNoHide crosshair when mouse leaves viewport/container.
childrenReact.ReactNodeNoContent inside CrosshairCursorArea (bounded mode).
showBracketsbooleantrueNoShow corner brackets (Area).
showBorderbooleanfalseNoShow border ring around Area.
classNamestringNoAdditional class for overlay / area wrapper.
labelClassNamestringNoClass for coordinate labels.
lineClassNamestringNoClass for line segments.
dotClassNamestringNoClass for center dot.
© reframe/ui 2026Built by @thommysart
More in Cursor Effects