A live Canvas 2D harmonograph: two damped pendulums over a slowly turning table draw one fine ink line into a rosette, and each finished figure rests briefly, fades away completely and only then gives way to the next, one figure at a time. The plate sways gently in 3D and leans toward the cursor; a click starts a new figure. Ink and paper, pace, pause between figures, line width and strength, damping, table spin, complexity, tilt and plate shape are all props. It pauses offscreen and shows a finished figure for reduced motion.
The import and the props worth knowing about, in one place.
import { Harmonograph } from "@/components/beste/component/harmonograph";
<Harmonograph className="aspect-square w-full max-w-[560px]" />
<Harmonograph
className="aspect-square w-full max-w-md"
inkColor="var(--primary)" // any CSS color, tokens included
duration={8} // seconds per figure
hold={0.4} // rest before the next figure starts
complexity={0.9} // more intricate ratios
spin={0.2} // a calmer table
tilt={0.8} // stronger sway and lean
round={false} // square sheet instead of a round plate
/>Read from the component's own type, so this cannot drift from what it accepts.
| Prop | Type | Default | Description |
|---|---|---|---|
inkColor | string | — | Color of the ink line. Any CSS color, tokens included. |
paperColor | string | — | Color of the plate the line is drawn on. |
duration | number | — | Seconds one figure takes to draw. |
hold | number | — | Seconds a finished figure rests before the next one begins drawing over its fading ghost. |
lineWidth | number | — | Width of the ink line, in pixels. |
lineOpacity | number | — | Strength of the ink, 0 to 1. Overlapping passes build up darker. |
damping | number | — | How slowly the pendulums settle, 0 (short, open figures) to 1 (long, dense rosettes). |
spin | number | — | How far the table turns under the pen, 0 (still table) to 1 (strong spiral). |
complexity | number | — | Range of frequency ratios the pendulums pick from, 0 (simple loops) to 1 (intricate knots). |
tilt | number | — | How far the plate sways and leans toward the cursor, 0 (flat) to 1. |
round | boolean | — | Round plate; turn off for a square sheet. |
interactive | boolean | — | The plate leans toward the cursor and a click starts a new figure. |
paused | boolean | — | Freeze the drawing and the sway where they are. |
className | string | — | |
children | ReactNode | — |