Text roll
A status line that changes in place: the old text leaves upward as the new one rises in.
import { TextRoll } from "@arcadia/ui"A status line that changes in place. The old text leaves upward as the new one rises in from below over --duration-slower, both clipped to the one line inside a soft top and bottom mask, so the row of text around it never jumps. Use it wherever a short phrase says what is happening now and is replaced by the next: a row's second line, a step's name, a counter's label.
The line takes the new text's width at once. Give it room, or its end fades.
Examples
The current text is in the page once, for a screen reader; the two rolling copies are hidden from it. Put the live-region role on the container, as the examples do with role="status", so each change is read once. Reduced motion swaps the text in place with no motion and no mask.
TextRoll
textrequired- string
- The line. When it changes, the old text leaves upward and the new one rises in from below.
rootStyle- RootStyle
- Typed StyleX override: where the line sits.
children- (text: string) => ReactNode
- Draws a line's visible text (default: the text itself): wrap it in a
Shimmerwhile the status is live.
Rest props go to HTMLAttributes<HTMLSpanElement>.