Skip to content

Options

ScrambleOptions

All parameters are optional unless noted.

ParameterTypeDefaultDescription
textstringelement’s textContentTarget text to reveal
from'left' | 'right' | 'center' | 'random''left'Direction of character reveal
charspreset name or custom string'blocks'Characters used during scramble. See Character Sets
cursorstring''Cursor pattern for sweep effect at the reveal front
durationnumber800Total animation duration in ms
delaynumber0Delay before animation starts in ms
easeeasing name or (t: number) => number'linear'Easing function. See Easing
stepsnumber10Step count when ease is 'steps'
perturbationnumber (0–1)0Randomization of reveal timing
revealRatenumberautoMaximum interval between character reveals in ms
settleDurationnumber250Time for each character to settle in ms
settleRatenumber30Interval between settle steps in ms
reversedbooleanfalseReverse the animation direction
overridestring | falsefalseOverride initial text (e.g. '' to start blank)
fillstring' 'Fill character for text length differences
seednumberrandomSeed for deterministic random generation
speednumber1Playback speed multiplier
loopboolean | numberfalseLoop: true for infinite, or a count
renderMode'auto' | 'text' | 'cells''auto'DOM rendering strategy. auto chooses stable cells for glyph sets likely to shift layout, text keeps natural text flow, and cells forces fixed character cells

Render Modes

Scrambl supports three DOM rendering modes:

  • auto: safety-first default. It switches to stable character cells for glyph sets that are more likely to jump in width or trigger fallback-font jitter, such as symbols, braille, blocks, and full-width kana.
  • text: natural text flow. This is the best choice for proportional fonts, brand type, and editorial layouts where you want the final text to feel like normal typography.
  • cells: fixed character cells. This is the most stable option for visually uneven glyphs, terminal-style treatments, and monospace presentations.
  • Use auto when you want a good default and do not need strict art direction.
  • Use text when the page uses a proportional font and you want the most natural result.
  • Use cells when you want the most stable decode effect and are happy with a gridded presentation.

Monospace guidance

cells mode is optimized for monospace or monospace-like presentation. It can still be used with proportional fonts, but some fonts will look tighter or more mechanical because each character is rendered inside a fixed-width cell.

Callbacks

CallbackTypeDescription
onStart() => voidFires when animation starts
onChange(text: string, progress: number) => voidFires each frame with current text and progress
onComplete() => voidFires when animation finishes

TriggerType (React / Vue only)

Framework adapters support an additional trigger option:

ValueDescription
'manual'Only plays when play() or replay() is called
'hover'Replays on pointerenter
'click'Replays on click
'inView'Plays once when the element enters the viewport