Installation
npx shadcn@latest add @iconiq/text-loopProps
TextLoop
Cycling text treatment that advances through child items on an interval, animating each change with a vertical slide and fade.
childrenReact.ReactNode[]Required
classNamestringintervalnumberDefault 1
transitionTransitionDefault { duration: 0.3 }
variantsVariantsonIndexChange(index: number) => voidThe component renders nothing when no children are provided.
AnimatePresence uses popLayout mode so outgoing and incoming items can overlap during the transition.
Loop and transition behavior
An internal interval increments a loop key on each tick, and the active child is resolved with modulo arithmetic so the sequence repeats indefinitely.
Default motion variants slide the incoming item up from 100% while the outgoing item exits toward -100%.
The exported useLoop hook exposes the same interval-driven key increment if you want to build a custom rotator around the same timing primitive.
Registry bundle
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: motion.