oxyn

Bar Plan: a loader for working a plan

A ring of bars cut into steps: done steps hold, the current one sweeps. A React loader for an AI agent working through a plan.

Installation

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

npx shadcn@latest add https://oxyn.space/r/bar-plan.json

Usage

Updates live with the parameters you set.

import { BarPlan } from "@/components/bar-plan";

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

Props

PropTypeDefaultDescription
barsnumber36Number of bars around the ring.
barHeightnumber12Resting height of each bar in px, pointing away from the center.
barWidthnumber2Thickness of each bar in px. Capped so neighbors never overlap.
radiusnumber1Corner radius of each bar in px.
extendnumber10How far the sweep grows a bar in px. Done steps hold at about 40% of it.
durationnumber0.24Seconds one bar takes to grow and settle as the sweep passes.
staggernumber0.06Seconds between one bar and the next as the sweep runs through the current step.
direction"out"|"in""out"Which way the push carries a bar: away from the center, or toward it.
stepsnumber4Steps in the plan, each an equal segment of the ring.
currentnumber1The step running now, counting from 0. Earlier steps show as done; set it to the step count when all are done.
sizenumber160Width and height of the orb in px.
minOpacitynumber0.35Opacity of resting bars. Bars at the peak of the wave are always fully opaque.
colorstring"#e4e4e7"Bar 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

Bar Plan is one of the animations in Bar Ring. Use the group when the agent's state changes, and it morphs between them.

More states

Also for this state