Skip to main content
Clever Ops

Survey Crosshair

Full-viewport drafting crosshair, hairline axes track the pointer with mono coordinate readouts in the margins, and hovering targets snaps brackets around them.

Preview & code

Loading Survey Crosshair preview

Installation

pnpm dlx shadcn@latest add @cleverui/cursor-crosshair-survey

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { CursorCrosshairSurvey } from '@/components/ui/cursor-crosshair-survey'
Exampletsx
import { CursorCrosshairSurvey } from '@/components/ui/cursor-crosshair-survey'

export default function CursorCrosshairSurveyDemo() {
  return (
    <div className="relative min-h-[560px] overflow-hidden">
      <CursorCrosshairSurvey />
      <div className="relative mx-auto flex min-h-[560px] max-w-4xl flex-col justify-center px-4 py-16 sm:px-6">
        <p className="font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
          Spectacle · survey the field
        </p>
        <h2 className="mt-4 max-w-xl text-3xl font-semibold tracking-tight text-balance sm:text-5xl">
          Measure what you point at.
        </h2>
        <p className="mt-4 max-w-md text-sm leading-relaxed text-muted-foreground">
          Hairline axes and margin coordinates. Hover a plate to snap the brackets.
        </p>

        <div className="mt-12 grid gap-4 sm:grid-cols-3">
          <button
            type="button"
            data-survey
            className="rounded-2xl border border-border/60 bg-card px-5 py-6 text-left transition-colors hover:border-border focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-hidden"
          >
            <span className="font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground">
              Plate 01
            </span>
            <p className="mt-2 text-sm font-medium text-foreground">North bearing</p>
            <p className="mt-1 text-xs text-muted-foreground">42° 18′ 06″ N</p>
          </button>
          <button
            type="button"
            data-survey
            className="rounded-2xl border border-border/60 bg-card px-5 py-6 text-left transition-colors hover:border-border focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-hidden"
          >
            <span className="font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground">
              Plate 02
            </span>
            <p className="mt-2 text-sm font-medium text-foreground">East station</p>
            <p className="mt-1 text-xs text-muted-foreground">71° 03′ 44″ W</p>
          </button>
          <button
            type="button"
            data-survey
            className="rounded-2xl border border-border/60 bg-card px-5 py-6 text-left transition-colors hover:border-border focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-hidden"
          >
            <span className="font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground">
              Plate 03
            </span>
            <p className="mt-2 text-sm font-medium text-foreground">Datum mark</p>
            <p className="mt-1 text-xs text-muted-foreground">EL +12.4 m</p>
          </button>
        </div>
      </div>
    </div>
  )
}

API reference

CursorCrosshairSurvey accepts the following props.

PropTypeDefaultDescription
targetSelectorstring'[data-survey]'elements that receive the snap brackets on hover
showCoordinatesbooleantrueshow mono coordinate readouts on the axis margins

…plus everything from React.HTMLAttributes<HTMLDivElement>: className, event handlers, aria attributes and the rest pass straight through.

Frequently asked questions

How do I install the Survey Crosshair component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/cursor-crosshair-survey`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Survey Crosshair require?

Survey Crosshair uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Survey Crosshair to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services