crucıble

Tote

A ranked bar race — the racetrack tote board. Rows that change rank physically slide past each other FLIP-style, the overtaker lifting over its neighbor with a soft shadow before seating flush; bars re-measure with a spring, values roll to their new numbers, and the leader's value carries a subtle brightness edge. Feed it frames and it plays the classic bar-chart race on an interval (suspended offscreen), politely announcing lead changes. Includes a segmented category-proportion variant.

motionpro

Installation

CLI

npx shadcn@latest add @crucible/tote

Manual — install dependencies, then copy the source

npm install motion

Props

PropTypeDefaultDescription
itemsToteItem[]Rows of the board. Input order also assigns ramp colors and breaks ties.
framesToteFrame[]Race mode: a time series of value snapshots the board steps through automatically. When provided, frame values override items[].value.
intervalnumber2Seconds each race frame holds before the next lands.
loopbooleantrueRestart the race from frame 0 after the last frame.
sort"desc" | "asc""desc"Rank order: highest value first, or lowest first.
reorderbooleantrueAnimate rank changes FLIP-style so rows slide past each other. When false the board still re-sorts and bars still spring, but rows swap instantly.
maxRowsnumberShow at most this many rows; movers animate in and out at the cutoff.
springToteSpringSpring used for row FLIP slides and bar width re-measures.
format(value: number) => stringFormats a value for display (also used mid-roll on interpolated values).
rollDurationnumber0.6Seconds a value takes to roll to its new number. 0 snaps.
colorsstring[]a cool analogous familyColor ramp assigned to items by input order (cycled) when an item carries no color of its own.
rowHeightnumber36Row height in px (also sizes the category bar at a third).
gapnumber8Gap between rows in px.
labelWidthnumber96Width of the label column in px.
variant"bars" | "category""bars"Render one segmented proportion bar (segments re-negotiate widths on change) instead of the ranked bar list. Segments keep input order.
showFrameLabelbooleantrueShow the current frame's caption above the board while racing.
pausedbooleanfalseSuspends race playback.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"div">, "children">they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, and passes className through.