streamdown

Render streaming Markdown in React chat interfaces with syntax highlighting and Mermaid diagrams.

7|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/Cobalt-Money/Cobalt --skill streamdown-cobalt-money
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: streamdown
Source: https://github.com/Cobalt-Money/Cobalt/tree/main/.agents/skills/streamdown
Command: npx skills add https://github.com/Cobalt-Money/Cobalt --skill streamdown-cobalt-money

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Streamdown solves the challenge of rendering Markdown in real-time AI chat interfaces by providing a streaming-optimized, secure, and feature-rich React component that handles incomplete syntax and interactive elements gracefully.

Core Features & Use Cases

  • Streaming Optimization: Automatically handles incomplete Markdown blocks (like partial code or math) during AI response generation to prevent layout shifts.
  • Rich Plugin Ecosystem: Supports syntax highlighting via Shiki, interactive Mermaid diagrams, KaTeX math rendering, and CJK text support.
  • Security & Control: Includes built-in XSS protection, link safety modals, and granular control over allowed HTML tags and URL protocols.

Quick Start

Integrate the Streamdown component into your chat interface by wrapping your message content and setting the isAnimating prop to true while the AI is generating the response.

Frequently Asked Questions about streamdown

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I render streaming Markdown in a React AI chat interface without layout shifts?

To render streaming Markdown in React without layout shifts, use a component that automatically handles incomplete syntax blocks during AI generation. This prevents visual jumps as partial code or math content streams in real-time.

Does this React Markdown renderer support syntax highlighting and Mermaid diagrams?

Yes, this React Markdown renderer supports syntax highlighting via Shiki, interactive Mermaid diagrams, and KaTeX math rendering. It provides a rich plugin ecosystem for displaying complex AI-generated content in chat interfaces.

How do I secure AI-generated Markdown content against XSS attacks in React?

To secure AI-generated Markdown content against XSS attacks, use a renderer with built-in sanitization. This component includes rehype-sanitize and harden plugins, offering granular control over allowed HTML tags and URL protocols.

Can I use Streamdown to render LaTeX math and CJK text in AI responses?

Yes, you can use Streamdown to render LaTeX math and CJK text in AI responses. It supports KaTeX math rendering and CJK text formatting, ensuring diverse content types display correctly in your chat interface.

What is the best way to handle incomplete Markdown blocks during AI response generation?

The best way to handle incomplete Markdown blocks during AI generation is using a streaming-optimized renderer. It gracefully processes partial code or math syntax, preventing rendering errors until the AI completes the response.

How do I integrate a streaming Markdown component into my existing React chat application?

To integrate a streaming Markdown component, wrap your message content and set the isAnimating prop to true during AI generation. This enables real-time UI updates while the response streams.