Docs
Random Letter Swap Hover

Random Letter Swap Hover

A text component that randomly swaps the letters vertically on hover.

Right here!Right here!Right now!Right now!Right here!Right here!Right now!Right now!

There are two types of animations available for this component:

  1. Forward animation — plays the animation timeline once forward.
  2. Ping Pong animation — plays the animation timeline in a ping pong fashion.

Source code


Install the following dependencies:

npm install lodash

Only forward animation

Ping Pong animation

Understanding the component


The component works the same as the Letter Swap Hover component, but with a random letter swapping animation (and of course, a slightly different implementation of the animation). Please refer to that documentation for more details.

Props


PropTypeDefaultDescription
label*string-The text to be displayed and animated
reversebooleantrueDirection of the animation (true: bottom to top, false: top to bottom)
transitionDynamicAnimationOptions{ type: "spring", duration: 0.7 }Animation configuration for each letter
staggerDurationnumber0.03Delay between each letter's animation start
classNamestring-Additional CSS classes for styling
onClick() => void-Callback function for click events