Skip to main content
Clever Ops

Plotter Trace

A pen plotter drafts a seeded schematic while your React app loads, stroke length bound to a 0-100 progress prop, percent stamped in a live title block. Canvas preloader in Tailwind tokens.

Preview & code

Loading Plotter Trace preview

Installation

pnpm dlx shadcn@latest add @cleverui/loader-plotter-trace

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

Usage

tsx
import { LoaderPlotterTrace } from '@/components/ui/loader-plotter-trace'
Exampletsx
'use client'

import { useEffect, useState } from 'react'
import { useReducedMotion } from 'motion/react'
import { LoaderPlotterTrace } from '@/components/ui/loader-plotter-trace'

export default function LoaderPlotterTraceDemo() {
  const reduced = useReducedMotion()
  const [progress, setProgress] = useState(8)

  useEffect(() => {
    if (reduced) {
      setProgress(64)
      return
    }
    const start = performance.now()
    let raf = 0
    const tick = (now: number) => {
      const t = Math.min(1, (now - start) / 9000)
      const eased = 1 - Math.pow(1 - t, 2.2)
      setProgress(8 + eased * 92)
      if (t < 1) raf = requestAnimationFrame(tick)
    }
    raf = requestAnimationFrame(tick)
    return () => cancelAnimationFrame(raf)
  }, [reduced])

  return (
    <div className="mx-auto flex w-full max-w-5xl flex-col gap-10 px-4 py-10 sm:px-6">
      <div className="overflow-hidden rounded-2xl border border-border/60">
        <LoaderPlotterTrace
          progress={progress}
          plateLabel="PLATE 07, ASSEMBLY"
          label="Drafting assembly"
          seed={7}
        />
      </div>
      <div className="overflow-hidden rounded-2xl border border-border/60">
        <LoaderPlotterTrace
          plateLabel="PLATE 12, FEED LOOP"
          label="Plotting continuously"
          seed={12}
          speed={1.1}
        />
      </div>
    </div>
  )
}

The example itself also uses motion , install it too if you copy the example as-is (the component itself does not need it).

API reference

LoaderPlotterTrace accepts the following props.

PropTypeDefaultDescription
progressnumberdeterminate 0-100, fraction of the plot's total path length drawn. Omit for indeterminate continuous plates
plateLabelstring'PLATE 07, ASSEMBLY'mono title-block line beside the percent
labelstring'Loading'seeds the aria announcement text
seednumber7selects the deterministic drawing; same seed replays the identical plot every mount
speednumber1indeterminate plotting rate multiplier

…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 Plotter Trace component?

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

Plotter Trace has no npm dependencies beyond React and Tailwind CSS itself, so there is nothing extra to install or keep updated.

Can I theme Plotter Trace 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