oxyn

Square Read: a loader for reading a file

A square grid of dots read row by row, like eyes moving over text. A React loader for an AI agent reading a file. Install with shadcn.

Installation

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

npx shadcn@latest add https://oxyn.space/r/square-read.json

Usage

Updates live with the parameters you set.

import { SquareRead } from "@/components/square-read";

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

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.
durationnumber3.5Seconds for one read of the whole sheet, from the first dot until the trail clears the last row.
gapnumber0.4Seconds to rest between reads.
trailnumber3Rows the fading trail covers behind the read head. Keep it to 3–4 so the line being read stays clear.
minOpacitynumber0.25Opacity of resting dots. The dot under the read head is 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.

Switch states

Square Read is one of the animations in Dot Square. Use the group when the agent's state changes, and it morphs between them.

More states

Also for this state