This component requires the
motion-sv dependency.Installation
Usage
Examples
Basic Example
Simple hyper text with default settings.Animate on Hover
Trigger the animation when hovering over the text.Custom Duration
Control how fast the scramble effect completes.Start on View
Animate when the element enters the viewport.With Delay
Delay the animation start.Custom Character Set
Define which characters to use during the scramble.Different Element Types
Render as different HTML elements.Styled Examples
Combine with custom styles.Props
The text to display and animate.
The duration in milliseconds for the complete animation sequence.
Delay in milliseconds before the animation starts.
Whether to trigger the animation on mouse hover.
Whether to trigger the animation when the element enters the viewport.
Array of characters to use during the scramble animation. Defaults to uppercase English alphabet.
The HTML element type to render. Options:
div, span, p, h1, h2, h3, h4, h5, h6.Additional CSS classes to apply to the component.
How It Works
The hyper text effect creates a “decryption” or “glitch” animation:- Initialization: Text starts as random characters from the character set
- Progressive reveal: Characters are revealed one by one from left to right
- Smooth transition: Each character cycles through random replacements before settling on the final character
- Monospace font: Uses font-mono to ensure consistent character widths
- Uppercase: Characters are displayed in uppercase for a more dramatic effect
Customization
Lowercase Text
Use lowercase character set and remove uppercase transform:Symbol Character Set
Use special characters for a hacker/matrix effect:Binary Effect
Use only 0s and 1s:Continuous Hover Animation
Disable initial animation and only animate on hover:Longer Scramble
Increase duration for a more dramatic effect:Use Cases
- Landing pages: Create attention-grabbing hero text
- Section headers: Add interest to content sections
- Loading states: Show dynamic loading text
- Hover effects: Add interactivity to navigation or CTAs
- Sci-fi themes: Perfect for tech or cyberpunk aesthetics
- Product launches: Create buzz with dynamic reveals
Accessibility
The component usesmotion-sv’s AnimatePresence for smooth transitions and maintains proper text content for screen readers. The actual text content is always present in the DOM, just visually scrambled during animation.
Spaces in the text are preserved and not scrambled, ensuring word boundaries remain clear during the animation.