Skip to content

Typing Animation

The TypingAnimation component reveals text one character at a time, simulating real-time text generation. It’s commonly used for AI assistant responses and chat interfaces. Since it extends the Text component, it accepts all of Text’s styling props.

Variations

Custom speed

Control the typing speed with typingSpeed (milliseconds per character).

With delay

Add a delay before the animation starts with delay (milliseconds).

With text variants

Because TypingAnimation extends TextProps, you can use any Text variant.

With colors

Installation

import { TypingAnimation } from "@harnessio/ui/components";
// Basic usage
<TypingAnimation text="Hello, world!" />
// With custom speed and delay
<TypingAnimation text="Welcome to the chat!" typingSpeed={30} delay={500} />
// With a completion callback
<TypingAnimation
text="Processing complete."
onComplete={() => console.log("Typing finished!")}
/>
// With Text styling
<TypingAnimation text="Important message" variant="heading-small" color="foreground-1" />;