StreamingArtifact
stablev1.0.0Renders streamed code, markdown, or text output with progressive disclosure, syntax highlighting via line-number table, diff view, and copy action. Integrates with useStream patterns via controlled content + state props.
import { StreamingArtifact } from "@nodus/design-system"Props
| Prop | Type | Default | Description |
|---|---|---|---|
contentreq | string | — | Content to render. May grow as streaming progresses. |
kind | "code" | "markdown" | "text" | "text" | Content type — controls rendering mode. |
language | string | — | Programming language hint for code kind. |
state | "streaming" | "complete" | "error" | "complete" | Current stream state. Controls cursor blink and auto-scroll. |
showLineNumbers | boolean | true | Show line numbers for code kind. |
diff | DiffLine[] | — | When provided, renders a diff view instead of plain content. |
showCopy | boolean | true | Show copy-to-clipboard button. |
maxHeight | string | number | 480 | Maximum visible height before scroll kicks in. |
label | string | — | Accessible region label. |
contentrequiredstringDefault —Content to render. May grow as streaming progresses.
kind"code" | "markdown" | "text"Default "text"Content type — controls rendering mode.
languagestringDefault —Programming language hint for code kind.
state"streaming" | "complete" | "error"Default "complete"Current stream state. Controls cursor blink and auto-scroll.
showLineNumbersbooleanDefault trueShow line numbers for code kind.
diffDiffLine[]Default —When provided, renders a diff view instead of plain content.
showCopybooleanDefault trueShow copy-to-clipboard button.
maxHeightstring | numberDefault 480Maximum visible height before scroll kicks in.
labelstringDefault —Accessible region label.
This component was designed to express:
Explore Related
Renders AI tool call execution: function name, input parameters (syntax-highlighted JSON with line numbers), status badge (pending/running/done/error), output preview, execution duration, and call ID. Collapsible detail panel.
Animated dot sequence for streaming/typing indicators
Live token usage counter with budget threshold