Text whose letters roll over one after another, like a flip board.
Installation
Usage
import { RollingText } from '@animate-ui/react/primitives/texts/rolling';
export function Title() {
return <RollingText text="Rolling Text" inView />;
}Animation
- Each letter turns over in 3D (
rotateX): its front copy rolls away from its upper quarter while the back copy rolls in from its baseline 0.3s later, 0.5s each on an ease-out. - Letters start 0.1s apart (the
delayoftransition). Words never break in the middle; emoji and accented letters stay whole. - Once rolled, the text stays rolled: leaving the viewport doesn't reverse it.
<AnimateUIProvider tempo>paces the default transition and the 0.3s offset.- Under reduced motion, the letters sit in their final state at once.
- Screen readers read the text once, not letter by letter.
API Reference
RollingText
| Prop | Type | Default |
|---|---|---|
text | string | - |
transition? | Transition | { duration: 0.5, delay: 0.1, ease: 'easeOut' } |
delay? | number | 0 |
inView? | boolean | false |
inViewMargin? | string | '0px' |
inViewOnce? | boolean | true |
...props? | Omit<React.ComponentProps<'span'>, 'children'> | - |