oxyn

Square Edit: a loader for editing a file

A square grid of dots where a few rows type in like a diff. A React loader for an AI agent editing 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-edit.json

Usage

Updates live with the parameters you set.

import { SquareEdit } from "@/components/square-edit";

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

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.6Seconds for one edit: typing its rows in, the cursor blink, and letting go.
gapnumber0.25Seconds to rest between edits.
minOpacitynumber0.25Opacity of resting dots. Typed dots 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.

Switch states

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

More states