Skip to content
Sign upPro
EffectsFlip dot displayMenu

Flip dot display (Pro)

ProIncluded in $99

An electromechanical flip dot sign for status words, streamed tokens and level columns. Discs turn on their axle, only where the picture changes, with a ragged mechanical ripple.

ProAn agent's run board on a 56 by 7 flip dot sign. Each step flips in disc by disc with a ragged mechanical ripple; long steps scroll through and hold at both ends.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/flip-dot-display

Needs chatcn Pro

This command works with a Pro license, along with every Pro component.

Or start free: sign up and get three Pro components on us, with a new one every month.

Usage

tsx
import { FlipDotDisplay } from "@/components/ui/chatcn/pro/flip-dot-display"

<FlipDotDisplay text={run.status} cols={56} onFlip={(count) => clicks.play(count)} />

Give a fixed cols to a value that changes, so the board keeps its width. Text is set in the kit's 5 by 7 dot font, uppercased, with one blank column between characters; narrow glyphs and spaces take their own width so words read evenly, and digits stay tabular. A change sends only the discs that differ, each after its own delay of 0 to 220 ms, so the board settles in a ragged ripple. sweep="column" turns that into a wave from the start edge.

When text grows by appending, as a streamed reply does, only the new characters' discs turn. Once it no longer fits, the board starts a fresh line at the word being written, so the end is always in view and the sign re-sets once per line instead of once per token. Streamed discs start within 90 ms of each other, so a line stays readable while tokens keep coming. Text that is replaced with something too wide scrolls through one column every 80 ms, holds at the end, and returns to the start; overflow="clip" cuts it instead.

Pass columns, one value from 0 to 1 per column, for bars from the bottom, or a getter for a live level that runs at the frame rate without re-rendering. Pass frame, a row major Uint8Array of 0 and 1, to draw anything else.

Examples

Streaming, level columns, sweep, scroll, pitch and reduced motion

ProA streamed reply, level columns from a simulated voice, the column sweep, scroll, two pitches and reduced motion.

Props

PropTypeNotes
textstringUppercased, in the 5 by 7 dot font
frameUint8ArrayRows of 0 and 1, row major. Wins over text
columnsnumber[] | () => Float32ArrayBars from the bottom, round(value * rows) discs each. Wins over both
rowsnumberDefault 7
colsnumberDefault: fits the text, at least 28
pitchnumberDisc pitch in CSS px. Default 10. Shrinks to fit a narrow container, in whole device px
overflow"scroll" | "clip"For text wider than the board. Default scroll
sweep"random" | "column"Ragged start, or a wave from the start edge
onFlip(count: number) => voidOnce per frame change, with the number of discs that turned. The board makes no sound
labelstringAccessible name. Defaults to the text
facestringLight face color. Default the lighter of the text and page tokens
reducedMotionbooleanForce it on or off. Defaults to the user's setting
paused, defaultPaused, onPausedChangebooleanControlled or uncontrolled pause of the scroll and of a level getter
pauseControlbooleanShow the pause button while something loops. Default true

Keyboard

KeyAction
Tab, EnterFocus and toggle the pause button, when it shows

Accessibility

  • The board is one role="img" named by its text, updated at most once a second, so a stream is not read token by token. Pass label for columns and frames.
  • The canvas is aria-hidden. The board always reads left to right, like a real sign, also inside right to left pages.
  • Under forced-colors: active the discs hide and the text shows plain inside an outline that keeps the board's place.
  • The light face and the board come from the text and page tokens, so the sign holds its contrast in every theme.

Motion

  • A disc turns about its diagonal axle: it narrows to its edge, shows the other face and eases onto its stop. 90 ms of swing, then 60 ms of settle, with nothing passing the stop. Each face darkens as it turns away from the light at the upper left.
  • Discs snap to whole device pixels. The three resting looks are drawn once; each frame repaints only the discs that are turning, so a board of thousands of discs costs nothing at rest.
  • Scroll steps and level columns turn in 75 ms with nearly no stagger, so moving text stays legible.
  • The loop runs at 60 fps only while discs turn. Through a scroll's hold it sleeps until the next step, and it stops offscreen, in hidden tabs and when paused.
  • Under reduced motion discs change face at once, with no turn and no stagger, and wide text rests at its start.