Examples
Default
Fake Placeholder
Sized To Current
Inside A Button
Inside A Status Row
Props
CyclingText
Cycles through a list of strings with a slide-in/slide-out animation. Lives inline so it can sit inside divs, spans, buttons, or as a fake placeholder overlay.Strings to cycle through, in order. Cycles back to the first after the last.
When
true, updates are exposed to assistive technologies via aria-live="polite". Leave false for decorative or frequently changing copy so screen readers are not interrupted on every cycle.Milliseconds to wait after the previous transition finishes before starting the next one.
Class applied to each visible label span (current + incoming). Use this for effects that have to sit on the text element itself, e.g.
background-clip: text.Called with the index of the settled, fully-visible item — once on mount and again whenever it changes (after each transition completes). Lets a parent stay in lockstep with what is on screen (e.g. to act on the item the user is currently looking at) without running a second, drifting timer of its own.
How the wrapper sizes itself horizontally.
longestreserves space for the longest item — no width jitter as items cycle.currentshrinks/grows with each item, animating width between cycles.
Exported types
Also exported from@fanvue/ui: CyclingTextProps, CyclingTextSizing.
Setup: Installation · Theming