Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Text

  • Text
  • Heading
  • SectionHeader
  • Prose
  • Markdown
  • Formula
  • AuroraText
  • LineShadowText
  • AnimatedShinyText
  • AnimatedGradientText
  • WordRotate
  • TypingAnimation
  • SparklesText
  • SplitText
  • BlurText
  • FlipText
  • TextReveal
  • DecryptedText
  • GlitchText
  • CircularText
  • ScrollReveal
  • TrueFocus
  • ASCIIText
  • CurvedLoop
  • FallingText
  • FuzzyText
  • ScrambledText
  • ScrollFloat
  • ScrollVelocity
  • Shuffle
  • TextCursor
  • TextPressure
  • VariableProximity

Code

  • Code
  • CodeBlock
  • Snippet
  • CodeDiff
  • Kbd

ScrambledText

scrambled-text

Temporarily scrambles characters before resolving the original text.

Usage

Basic usage

Move the pointer over the text, and the characters within the radius will roll over one by one into garbled characters and then converge back to the original characters.

Move the pointer over this text. Hover scrambles the glyphs.

tsx
<ScrambledText>
  Move the pointer over this text. Hover scrambles the glyphs.
</ScrambledText>

Effective radius

radius controls how close the pointer is to the characters in px before triggering the roll. The larger the pointer, the wider the range.

HULIAN UI · Scramble On Hover

tsx
<ScrambledText radius={160}>
  HULIAN UI · Scramble On Hover
</ScrambledText>

Custom character set

scrambleChars Determine the characters used for random replacement during the garbled process, and replace them with full-width block characters for a more deconstructed feel.

HULIAN UI · Scramble On Hover

tsx
<ScrambledText scrambleChars="█▓▒░">
  HULIAN UI · Scramble On Hover
</ScrambledText>

Fast convergence

When speed is turned up and duration is turned down, the garbled characters flash faster and the words return more rapidly, like binary decay.

0101 binary decay 1010

tsx
<ScrambledText duration={0.6} speed={0.9} scrambleChars="01">
  0101 binary decay 1010
</ScrambledText>

When to use

Use ScrambledText when moving the pointer across a title or subtitle should make nearby glyphs scramble and then resolve. Use FuzzyText for a persistent pixel-noise texture, or ScrollFloat and Reveal for entrance animations. ScrambledText keeps the final copy readable and limits the effect to characters inside the pointer radius.

Import

ts
import { ScrambledText } from "@hulianui/ui"

Props

NameTypeDefaultDescription
radiusnumber100Pointer radius in px. A character scrambles only when its center falls within this radius.
durationnumber1.2Maximum scramble duration per character in seconds; characters nearer the pointer approach this value.
speednumber0.5Replacement speed from 0-1; higher values change glyphs more frequently and resolve faster.
scrambleCharsstring".:"Characters sampled as temporary replacements.
classNamestring-Additional root class name, merged with cn.
styleCSSProperties-Inline styles for the root element.

Slots

SlotTypeDescription
children*ReactNodeText to be scrambled word by word (plain text only, internally split into single-character spans)

Example

tsx
// Default: .: character set
<ScrambledText>Move the pointer over this text. Hover scrambles the glyphs.</ScrambledText>

// Large radius + full width symbol set
<ScrambledText radius={160} scrambleChars="█▓▒░">
  HULIAN UI · Scramble On Hover
</ScrambledText>

Usage guidelines

  • children must be plain text. The component splits it into per-character spans, so nested element structure cannot be preserved.
  • Radius is measured from each character's center. Characters far from the pointer in a long passage may barely move; this is intentional.
  • With reduced motion enabled, the original text renders directly without scrambling.

Related

Text · Heading · Prose · Markdown · AuroraText · AnimatedShinyText

Playground

Move the pointer over this text. Hover scrambles the glyphs.

<ScrambledText
  radius={100}
  duration={1.2}
  speed={0.5}
  scrambleChars=".:"
>
  Move the pointer over this text. Hover scrambles the glyphs.
</ScrambledText>
PreviousFuzzyTextTypographyNextScrollFloat

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Slots
    • Example
    • Usage guidelines
    • Related
  • Playground