AnimationUpdated in v15

Blur Text

Text that blurs into place when it scrolls into view.

Installation

Import the class, and @use the entry point in your global styles: without it the component renders unstyled.

import { Component } from '@angular/core';
import { WrBlurText } from 'ngwr/bits/blur-text';

@Component({ imports: [WrBlurText] })
export class MyComponent {}
Angular adaptation of an effect by David Haz / reactbits.dev.

Playground

Welcome to ngwr
<wr-blur-text
  text="Welcome to ngwr"
  animateBy="words"
  direction="top"
  [delay]="200"
  [stepDuration]="0.35"
/>

Customize

Animate By
Direction
Delay (ms)
200 ms
Step Duration (s)
0.35 s
Text

Server rendering

Prerendered text stays as it is when the page hydrates. The entrance plays when the component is created in the browser and when text changes. Since v15.

API

NameDescriptionTypeDefault
textrequiredText to animate.string—
animateBySplit granularity.'chars' | 'words''words'
directionEntry direction: 'top' slides down into place, 'bottom' slides up.'top' | 'bottom''top'
delayPer-piece stagger in ms.number200
stepDurationDuration of each keyframe step in seconds (total = 2 × stepDuration).number0.35
easingCSS easing function.string'linear'
thresholdIntersectionObserver threshold (0..1).number0.1
rootMarginIntersectionObserver rootMargin.string'0px'
(animationComplete)Emitted once all pieces finish animating.void—

See also