Docs
Scramble In

Scramble In

A text component that reveals the text with a scrambled part in front.

Source code


Usage


With the autoStart prop, you can start the animation automatically. But there is also a start and reset method exposed via a ref if you need to control the animation from outside of the component, as you see in the demo above.

Props


PropTypeDefaultDescription
text*string-The text to be displayed and scrambled
scrambleSpeednumber50Speed of the scrambling animation in milliseconds
scrambledLetterCountnumber8Number of letters to scramble
autoStartbooleantrueWhether to start the animation automatically
classNamestringundefinedAdditional CSS classes for styling
charactersstring"ABCDEFGHIJKLMNO PQRSTUVWXYZ abcdefghijklmno pqrstuvwxyz !@#$%^&*()_+"Characters to use for scrambling
scrambledClassNamestringundefinedAdditional CSS classes for styling the scrambled text
autoStartbooleantrueWhether to start the animation automatically
onComplete() => void-Callback function for when the animation completes
onStart() => void-Callback function for when the animation starts