TextDecode

Character-by-character decode — each glyph cycles through a pool of random characters before settling on the target. The element's text content is captured on mount and used as the destination. GSAP-backed.

Decoding the boogie

Usage

import { TextDecode } from '@bwo-ui/react';

<TextDecode as="h1" duration={1.6}>
  Welcome aboard.
</TextDecode>

// Looping with a custom pool
<TextDecode
  loop
  chars="01"
  duration={2}
>
  System online
</TextDecode>

Props

PropTypeDefaultDescription
durationnumber1.4Total animation duration in seconds.
charsstringPool of characters used for the scramble. Defaults to alphanumerics + symbols.
speednumber0.04Seconds per character swap during the scramble.
delaynumber0Delay before the decode begins.
loopbooleanfalseReplay forever.
onComplete() => voidFires when every character has settled.
asElementType'span'Tag to render.