cnippet/ui
  1. motion
  2. text animations
  3. scramble hover

text animations

Scramble Hover

Text scrambles through random characters on hover, then resolves back to the original string when the cursor leaves.

Installation

Usage

Anatomy

Good to know

  • children must be a plain string.
  • The effect plays on hover, so there's nothing to see on touch screens.
  • Set useOriginalCharsOnly to scramble with the text's own letters instead of characterSet.
  • Screen readers get the text through aria-label; the scrambled characters are hidden from them.
  • When the user has turned on reduced motion, hovering does not scramble the text; onHoverStart and onHoverEnd still fire.

Props

Examples

A row of nav items that each scramble independently on hover. Lower scrambleSpeed and maxIterations keep it snappy.

Hero Heading

Full heading scrambles with revealDirection="center" for a symmetric decode effect. Pairs well with a supporting label.

Repository Card

Multiple ScrambleHover instances inside a card — title decodes left-to-right while metadata uses useOriginalCharsOnly for a subtler shuffle.