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

Shuffle

shuffle

Scrambles characters and then locks the original text into place in sequence.

Usage

Basic usage

Shuffle and decrypt word by word. Each word bit is first rolled into a random garbled code and then locked to the real word in directional order; hovering can be reshuffled.

HULIAN

tsx
<Shuffle
  text="HULIAN"
  triggerOnHover
  className="text-3xl font-semibold tracking-wide"
/>

Parse left

When shuffleDirection=left, the characters are locked from right to left, and duration controls the entire duration.

DECRYPTING…

tsx
<Shuffle
  text="DECRYPTING…"
  shuffleDirection="left"
  duration={0.9}
  triggerOnHover
  className="text-2xl font-medium tracking-widest"
/>

Loop + custom character set

loop cycle rewashing, scrambleCharset limited garbled sampling characters (only hexadecimal characters here).

0xC0FFEE

tsx
<Shuffle
  text="0xC0FFEE"
  loop
  loopDelay={1.2}
  scrambleCharset="0123456789ABCDEF"
  duration={0.7}
  className="text-3xl font-bold"
/>

When to use

Use Shuffle for a terminal- or decryption-style title that scrambles and then resolves character by character. Use TextPressure for pointer-distance deformation, AuroraText for a flowing gradient, or Text for ordinary static copy.

Import

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

Props

NameTypeDefaultDescription
text*string-The final rendered text (the parsing target)
durationnumber0.6Total animation duration in seconds; each character's resolve point is based on its index.
shuffleDirection"left" | "right""right"Resolve order: left resolves right-to-left; right resolves left-to-right.
scrambleCharsetstringUppercase letters + numbers + a few symbolsBefore parsing, each character is randomly selected and flashes into a garbled character set.
loopbooleanfalseWhether to clear the rewash cycle after parsing is completed
loopDelaynumber1Loop interval (seconds, only valid when looping)
triggerOnViewbooleantrueTriggered only when entering the viewport (IntersectionObserver)
triggerOncebooleantrueWhether triggerOnView is only triggered once when entering the viewport
triggerOnHoverbooleanfalseReshuffle the cards when the mouse moves in (the animation will only respond when it is idle)
tag"p" | "span" | "div" | "h1" | "h2" | "h3" | "h4""p"render tag
textAlignCSSProperties["textAlign"]"center"text alignment
classNamestring-The class name merged into the root element
styleCSSProperties-Inline styles (merged with textAlign)

Events

EventTypeDescription
onShuffleComplete() => voidParsing completion callback (triggered at the end of each round when looping)

Example

tsx
// Reshuffle on hover instead of viewport entry
<Shuffle
  text="HULIAN"
  triggerOnView={false}
  triggerOnHover
  className="text-3xl font-semibold tracking-wide"
/>

// Loop with a hexadecimal character set
<Shuffle
  text="0xC0FFEE"
  loop
  loopDelay={1.2}
  scrambleCharset="0123456789ABCDEF"
  duration={0.7}
  triggerOnView={false}
/>

Usage guidelines

  • triggerOnView defaults to true, so the animation waits for viewport entry. Set triggerOnView={false} on a fixed demo stage when it should start by another trigger.
  • triggerOnHover responds only while idle; hovering during an active shuffle does not restart or interrupt it.
  • Reduced-motion mode renders the final text immediately without scrambling.

Related

Text · Heading · Prose · Markdown · AuroraText · AnimatedShinyText

Playground

HULIAN

<Shuffle
  text="HULIAN"
  duration={0.6}
  shuffleDirection="right"
  loop={false}
  triggerOnHover={true}
  className="text-3xl font-semibold"
/>
PreviousScrollVelocityTypographyNextTextCursor

On this page

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