typeflow.js

v0.35.0

Type, erase, and morph text in the browser. Animate plain text or sanitized HTML, compose sequences, and control timing and cancellation.

npm install @staticcanvas/typeflow

Animation preview

Typewriter animation Library
typeStyle: char · eraseStyle: end
bash npm
npm install @staticcanvas/typeflow
app.js ESM
import { TypeFlow } from "@staticcanvas/typeflow";

const target = document.createElement("p");
document.body.append(target);

TypeFlow.type(target, "Hello, world.", {
  speed: 30,
});

Browser entry point · bundle with your app.

Animation options

Configure reveal and erase styles, timing, cursors, and sequences.

Browse effects

Reveal styles

Type by character or word, dissolve a trailing edge, or place words through spatial motion.

  • char
  • word
  • fade-trail
  • zoom-in-space

Erase styles

Backspace from either edge, collapse toward the center, fade, scramble, or remove instantly.

  • end
  • start
  • center
  • fade

Timing and cursors

Adjust cadence, direction, stagger, distance, depth, easing, cursors, and reduced-motion behavior.

  • speed
  • wordStagger
  • easing
  • naturalCadence

Morphing, streaming, and sequences

Morph existing copy, stream live tokens, stagger multiple targets, or pair motion with procedural audio.

  • morph
  • stream
  • sequence
  • audio

Reveal and erase examples

Open playground
typeStyle: char eraseStyle: end

Standard Typewriter

typeStyle: word eraseStyle: word

Word-by-word typing

typeStyle: fade-trail eraseStyle: fade-trail

Trailing Fade Gradient

typeStyle: scramble charset: matrix

Matrix character scramble

direction: center eraseStyle: center

Center Expansion & Shrink

direction: right eraseStyle: start

Reverse RTL Typing

typeStyle: morph TypeFlow.morph()

Text morphing

typeStyle: scramble charset: runic

Runic character scramble

typeStyle: natural naturalCadence: true

Natural Human Cadence

typeStyle: char eraseStyle: instant

Instant reset

typeStyle: scramble charset: hieroglyphs

Hieroglyph character scramble

typeStyle: stagger stagger: 220ms

Staggered targets

Sequences

Construct multi-step animations, dialogues, and coordinated DOM sequences with TypeFlow.

Framework adapters

Lightweight zero-dependency adapter factories and integration hooks for React, Vue 3, Svelte, Solid.js, Alpine.js, Web Components, and Angular.

HTML & sanitization

Type formatted HTML markup safely with allowlist sanitization and balanced tag trees.

Accessibility

Guidelines for reduced motion support, ARIA live regions, and screen reader ergonomics.

Companion Extensions

Modular opt-in extensions for performance telemetry, Web Audio, keystroke dynamics, debugging, and extended Unicode charsets.