Skip to content

StreamingArtifact

stablev1.0.0

Renders 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.

ai-agentInteractive/Storybook ↗
import { StreamingArtifact } from "@nodus/design-system"
Loading demo…

Props

contentrequired
Type stringDefault

Content to render. May grow as streaming progresses.

kind
Type "code" | "markdown" | "text"Default "text"

Content type — controls rendering mode.

language
Type stringDefault

Programming language hint for code kind.

state
Type "streaming" | "complete" | "error"Default "complete"

Current stream state. Controls cursor blink and auto-scroll.

showLineNumbers
Type booleanDefault true

Show line numbers for code kind.

diff
Type DiffLine[]Default

When provided, renders a diff view instead of plain content.

showCopy
Type booleanDefault true

Show copy-to-clipboard button.

maxHeight
Type string | numberDefault 480

Maximum visible height before scroll kicks in.

label
Type stringDefault

Accessible region label.

Metadatasemantictypemotionsurfaceborder
Design Rationale

This component was designed to express:

Explore Related

Was this helpful?