oxyn
All components

Square Wave

2D

A flat square of dots that breathes in a sweep from left to right, each column swelling a beat after the one before it.

square-wave.tsx

Installation

Install with the shadcn CLI, or copy the component file. It only needs React.

npx shadcn@latest add https://your-domain.com/r/square-wave.json

Usage

Updates live with the parameters you set.

import { SquareWave } from "@/components/square-wave";

export function Thinking() {
  return (
    <SquareWave />
  );
}

Props

PropTypeDefaultDescription
dotShape"round" | "square""round"Shape of each dot.
dotSizenumber2.5Resting dot size in px.
scalenumber1.5How many times larger a dot grows at the peak of the animation.
densitynumber11Dots across the width of the sheet.
sizenumber160Width and height of the orb in px.
durationnumber1.2Seconds for one dot's full breath (grow, then shrink).
gapnumber0.3Seconds to rest between waves.
spreadnumber0.9Seconds the far side lags behind the near side. Higher values make a slower, narrower wave.
direction"right" | "left""right""right" sweeps from left to right; "left" sweeps from right to left.
minOpacitynumber0.25Opacity of resting dots. Dots at full size are always fully opaque.
colorstring"#e4e4e7"Dot color.
pausedbooleanfalseCoast to a stop on the current frame without unmounting. Turning it off eases back up to speed.
labelstring"Thinking"Accessible name; the wrapper is role="status".
className / style——Spread onto the wrapper div, along with any other div props.