AI Components / Streaming Text
Streaming Text
Token-by-token text renderer with blinking cursor and markdown. Use appendText() to stream, complete() to finish.
ai-display v0.2.0
Playground
Examples
Live streaming
<ai-streaming-text style="max-width:520px;"></ai-streaming-text> Markdown rendered
<ai-streaming-text style="max-width:520px;"></ai-streaming-text> Plain text
<ai-streaming-text markdown="false" streaming content="This is plain text without any markdown rendering. The cursor blinks while streaming is active." style="max-width:520px;"></ai-streaming-text> Import
import { AiStreamingText } from '@cognivo/components'; // Or tree-shake: import '@cognivo/components/ai-streaming-text'; Per-component imports ship only that component (~8 kB gzip).
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
content | string | — | Current text content |
streaming | boolean | false | Active streaming — shows cursor |
showCursor | boolean | true | Show blinking cursor while streaming |
markdown | boolean | true | Render basic markdown (bold, italic, code, lists, headings, links) |
Events
| Event | Detail | Description |
|---|---|---|
ai-streaming-chunk | {chunk: string, total: string} | New text chunk appended |
ai-streaming-complete | {content: string} | Streaming finished |