Square Stream: a loader for running a command
Output lines land row by row like a terminal. A React loader for an AI agent running a command or streaming output. 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-stream.jsonUsage
Updates live with the parameters you set.
import { SquareStream } from "@/components/square-stream";
export function Thinking() {
return (
<SquareStream />
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| dotShape | "round"|"square" | "round" | Shape of each dot. |
| dotSize | number | 2.5 | Resting dot size in px. |
| scale | number | 1.5 | How many times larger a dot grows at the peak of the animation. |
| density | number | 11 | Dots across the width of the sheet. |
| size | number | 160 | Width and height of the orb in px. |
| duration | number | 1.6 | Seconds for output lines to land on every row once, top to bottom. |
| trail | number | 3 | Older lines still lit behind the newest; each steps down as the next lands. Keep it to 3–4 so the newest line stays clear. |
| minOpacity | number | 0.25 | Opacity of resting dots. The newest line is always fully opaque. |
| color | string | "#e4e4e7" | Dot color. |
| paused | boolean | false | Coast to a stop on the current frame without unmounting. Turning it off eases back up to speed. |
| label | string | "Thinking" | Accessible name; the wrapper is role="status". |
| className / style | — | — | Spread onto the wrapper div, along with any other div props. |
Switch states
Square Stream is one of the animations in Dot Square. Use the group when the agent's state changes, and it morphs between them.