Skip to main content
Clever Ops

Pantograph Copier

A working pantograph for React, trace in the source plate and a four-bar linkage redraws your stroke at scale in primary ink. Keyboard steerable, touch native, Tailwind tokens.

Preview & code

Loading Pantograph Copier preview

Installation

pnpm dlx shadcn@latest add @cleverui/pantograph-copier

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

Usage

tsx
import { PantographCopier } from '@/components/ui/pantograph-copier'
Exampletsx
import { PantographCopier } from '@/components/ui/pantograph-copier'

export default function PantographCopierDemo() {
  return (
    <div className="mx-auto w-full max-w-3xl px-4 py-10 sm:px-6 sm:py-14">
      <p className="mb-4 font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
        Spectacle · drafting instrument
      </p>
      <h2 className="mb-6 text-2xl font-semibold tracking-tight text-balance sm:text-3xl">
        Trace once. The linkage redraws at scale.
      </h2>
      <PantographCopier
        scaleFactor={2}
        strokeLimit={600}
        caption="PANTOGRAPH · ×2"
        ariaLabel="Pantograph copier"
      />
      <p className="mt-4 text-sm leading-relaxed text-muted-foreground">
        Drag the tracer ring inside the TRACE plate, or tab the stage and hold
        arrow keys. The four-bar parallelogram lays the same path in primary ink
        on COPY. Clear wipes both plates.
      </p>
    </div>
  )
}

API reference

PantographCopier accepts the following props.

PropTypeDefaultDescription
scaleFactornumber2copy magnification (clamped 1.5-3)
strokeLimitnumber600stored path points before the oldest fade (halved on coarse pointers)
captionstring'PANTOGRAPH · ×2'mono micro-label on the stage frame
ariaLabelstring'Pantograph copier'accessible name for the drawing stage

…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 Pantograph Copier component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/pantograph-copier`. 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 Pantograph Copier require?

Pantograph Copier 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 Pantograph Copier 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