StreamingText

Animates text character by character with a blinking cursor, simulating LLM streaming output.

Live Demo

The quick brown fox jumps over the lazy dog.

Faster stream at 10ms per character.

Custom pipe cursor.

No cursor shown here.

Props

PropTypeDefaultDescription
textstringThe full text string to animate.
speednumber30Milliseconds between each character.
cursorbooleantrueShow a blinking cursor while streaming.
cursorCharstring'▋'Character used as the cursor.
onComplete() => voidCalled when the animation finishes.

Usage

import { StreamingText } from '@ghiberti85/ui'

// Basic usage
<StreamingText text="Hello, world!" />

// Custom speed and cursor
<StreamingText text="Fast stream" speed={10} cursorChar="|" />

// No cursor
<StreamingText text="No cursor" cursor={false} />

// With completion callback
<StreamingText
  text="Done!"
  onComplete={() => console.log('finished')}
/>

// Simulated LLM streaming
const [text, setText] = useState('')
// Update text as chunks arrive from your API
<StreamingText text={text} speed={1} />

View in Storybook

Open in Storybook
Ghiberti UI — Design System