Docs
Scramble Hover

Scramble Hover

A text component that scrambles the text on hover.

Llama 3.1 405B Instruct Turbo
Llama 3.2 3B Instruct Turbo
Gemma 2 27B
Mistral 7B Instruct v0.3
Mixtral 8x7B Instruct
DeepSeek LLM Chat 67B
Qwen 2.5 72B Instruct Turbo
WizardLM 2 8x22B
Nous Hermes 2 Mixtral
StripedHyena Nous 7B
DBRX Instruct
MythoMax L2 13B
SOLAR 10.7B Instruct
Gemma 2B Instruct

Source code


Usage


For the scrambling effect, you can use either the original characters, or another set of characters specified in the characters prop.

original charactersnew characters

You can also apply a different styling on the scrambled text by passing a string to the scrambleClassName prop. This allows for example to use a different font family or color, like in the following example. Please not that if the scrambledClassName is applied, it's not going to be merged with the className prop, so you have to style the original text and the scrambled text separately.

special symbols

With the sequential prop, you can scramble the text in a sequential manner, starting from the start, the end, or the center of the text. In that case, the maxIterations prop is ignored. In my experience this works best with a monospaced font, but feel free to experiment.

from the start
from the center
from the end

Props


PropTypeDefaultDescription

text*

string-The text to be displayed and scrambled
scrambleSpeednumber50Speed of the scrambling animation in milliseconds
maxIterationsnumber10Maximum number of iterations for the scrambling animation
sequentialbooleanfalseWhether to scramble the text sequentially
revealDirection"start" | "end" | "center""start"The direction to reveal the scrambled text
useOriginalCharsOnlybooleantrueWhether to use only the original characters or the whole string
classNamestringundefinedAdditional CSS classes for styling
charactersstring"ABCDEFGHIJKLMNO PQRSTUVWXYZ abcdefghijklmno pqrstuvwxyz !@#$%^&*()_+"Characters to use for scrambling, if useOriginalCharsOnly is false
scrambledClassNamestringundefinedAdditional CSS classes for styling the scrambled text