Dot Twist: a loader for solving
A dot sphere that scrambles and solves itself like a twisty cube. A React loader for an agent reasoning through a problem.
Installation
Install with the shadcn CLI, or copy the component file. It only needs React.
npx shadcn@latest add https://oxyn.space/r/dot-twist.jsonUsage
Updates live with the parameters you set.
import { DotTwist } from "@/components/dot-twist";
export function Thinking() {
return (
<DotTwist />
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| pattern | "rings"|"fibonacci"|"grid" | "grid" | How the dots are laid out on the sphere. |
| dotSize | number | 3 | Diameter of the front dots in px. Back dots scale down automatically. |
| density | number | 12 | Rows of dots. Higher means more dots. |
| size | number | 160 | Width and height of the orb in px. |
| moves | number | 4 | Turns in each scramble. The same turns then play back in reverse to solve the orb. |
| duration | number | 0.5 | Seconds for one turn. |
| gap | number | 0.4 | Seconds the orb holds once scrambled, and again once solved. |
| tilt | number | 18 | Lean toward the viewer in degrees, so the top shows. |
| backOpacity | number | 0.2 | Opacity of the furthest dots. Front dots are 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
Dot Twist is one of the animations in Dot Globe. Use the group when the agent's state changes, and it morphs between them.