Animation

Rotating Text

Cycles through a list of strings, animating each transition character-by-character (or word/line). Auto-advances on a timer by default; also controllable imperatively via next() / previous() / jumpTo() / reset().

Angular adaptation of an effect by David Haz / reactbits.dev.

Import

import { WrRotatingText } from 'ngwr/rotating-text';

Playground

We design every day.
<wr-rotating-text
  [texts]="['design', 'ship', 'iterate']"
  [rotationInterval]="2000"
  splitBy="characters"
  [duration]="0.6"
  easing="cubic-bezier(0.16, 1, 0.3, 1)"
  [staggerDuration]="0"
  staggerFrom="first"
  [loop]="true"
/>

Customize

Interval (ms)
2000 ms
Split By
Duration (s)
0.60 s
Easing
Stagger (s)
0.00 s
Stagger From
Loop

API

NameDescriptionTypeDefault
textsrequiredStrings to cycle.readonly string[]— (required)
rotationIntervalAuto-advance interval in ms.number2000
splitByGranularity of the split.'characters' | 'words' | 'lines''characters'
autoAuto-advance on a timer.booleantrue
loopLoop back to the first string after the last.booleantrue
durationPer-swap tween duration in seconds.number0.6
easingCSS easing of the per-piece tween.string'cubic-bezier(0.16, 1, 0.3, 1)'
staggerDurationPer-piece stagger in seconds.number0
staggerFromStagger origin.'first' | 'last' | 'center''first'
(nextChange)Emits with the new index on every rotation.EventEmitter<number>
next() / previous() / jumpTo(i) / reset()Imperative methods on the component instance.method