Skip to content
streamdown logo

Streamdown

streamdown

Implement, configure, and customize Streamdown — a streaming-optimized React Markdown renderer with syntax highlighting, Mermaid diagrams, math rendering, and CJK support. Use when working with Streamdown setup, configuration, plugins, styling, security, or integration with AI streaming (e.g., Vercel AI SDK). Triggers on: (1) Installing or setting up Streamdown, (2) Configuring plugins (code, mermaid, math, cjk), (3) Styling or theming Streamdown output, (4) Integrating with AI chat/streaming, (5) Configuring security, link safety, or custom HTML tags, (6) Using carets, static mode, or custom components, (7) Troubleshooting Tailwind, Shiki, or Vite issues.

SKILL.md

Full skill instructions

Streamdown

Streaming-optimized React Markdown renderer. Drop-in replacement for react-markdown with built-in streaming support, security, and interactive controls.

Quick Setup

1. Install

npm install streamdown

Optional plugins (install only what's needed):

npm install @streamdown/​code @streamdown/​mermaid @streamdown/​math @streamdown/​cjk

2. Configure Tailwind CSS (Required)

This is the most commonly missed step. Streamdown uses Tailwind for styling and the dist files must be scanned.

Tailwind v4 — add to globals.css:

@source "../​node_modules/​streamdown/​dist/​*.js";

Add plugin @source lines only for packages you have installed (omitting uninstalled plugins avoids Tailwind errors). See plugin pages for exact paths:

  • Code: @source "../​node_modules/​@streamdown/​code/​dist/​*.js";
  • CJK: @source "../​node_modules/​@streamdown/​cjk/​dist/​*.js";
  • Math: @source "../​node_modules/​@streamdown/​math/​dist/​*.js";
  • Mermaid: @source "../​node_modules/​@streamdown/​mermaid/​dist/​*.js";

Tailwind v3 — add to tailwind.config.js:

module.exports = {
  content: [
    "./​app/​**/​*.{js,ts,jsx,tsx,mdx}",
    "./​node_modules/​streamdown/​dist/​*.js",
  ],
};

3. Basic Usage

import { Streamdown } from 'streamdown';

<Streamdown>{markdown}</​Streamdown>

4. With AI Streaming (Vercel AI SDK)

'use client';
import { useChat } from '@ai-sdk/​react';
import { Streamdown } from 'streamdown';
import { code } from '@streamdown/​code';

export default function Chat() {
  const { messages, input, handleInputChange, handleSubmit, isLoading } = useChat();

  return (
    <>
      {messages.map((msg, i) => (
        <Streamdown
          key={msg.id}
          plugins={{ code }}
          caret="block"
          isAnimating={isLoading && i === messages.length - 1 && msg.role === 'assistant'}
        >
          {msg.content}
        </​Streamdown>
      ))}
      <form onSubmit={handleSubmit}>
        <input value={input} onChange={handleInputChange} disabled={isLoading} />
      </​form>
    </>
  );
}

5. Static Mode (Blogs, Docs)

<Streamdown mode="static" plugins={{ code }}>
  {content}
</​Streamdown>

Key Props

PropTypeDefaultPurpose
childrenstring—Markdown content
mode"streaming" | "static""streaming"Rendering mode
plugins{ code?, mermaid?, math?, cjk? }—Feature plugins
isAnimatingbooleanfalseStreaming indicator
caret"block" | "circle"—Cursor style
componentsComponents—Custom element overrides
controlsboolean | objecttrueInteractive buttons
linkSafetyLinkSafetyConfig{ enabled: true }Link confirmation modal
shikiTheme[light, dark]['github-light', 'github-dark']Code themes
classNamestring—Container class
allowedElementsstring[]allTag names to allow
disallowedElementsstring[][]Tag names to disallow
allowElementAllowElement—Custom element filter
unwrapDisallowedbooleanfalseKeep children of disallowed elements
skipHtmlbooleanfalseIgnore raw HTML
urlTransformUrlTransformdefaultUrlTransformTransform/​sanitize URLs

For full API reference, see references/​api.md.

Plugin Quick Reference

PluginPackagePurpose
Code@streamdown/​codeSyntax highlighting (Shiki, 200+ languages)
Mermaid@streamdown/​mermaidDiagrams (flowcharts, sequence, etc.)
Math@streamdown/​mathLaTeX via KaTeX (requires CSS import)
CJK@streamdown/​cjkChinese/​Japanese/​Korean text support

Math requires CSS:

import 'katex/​dist/​katex.min.css';

For plugin configuration details, see references/​plugins.md.

References

Use these for deeper implementation details:

Example Configurations

Copy and adapt from assets/​examples/:

Common Gotchas

  1. Tailwind styles missing — Add @source directive or content entry for node_modules/​streamdown/​dist/​*.js
  2. Math not rendering — Import katex/​dist/​katex.min.css
  3. Caret not showing — Both caret prop AND isAnimating={true} are required
  4. Copy buttons during streaming — Disabled automatically when isAnimating={true}
  5. Link safety modal appearing — Enabled by default; disable with linkSafety={{ enabled: false }}
  6. Shiki warning in Next.js — Install shiki explicitly, add to transpilePackages
  7. allowedTags not working — Only works with default rehype plugins
  8. Math uses $$ not $ — Single dollar is disabled by default to avoid currency conflicts

More Cloud & Infrastructure skills

web-design-guidelines logo
Cloud & Infrastructure

web-design-guidelines

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

31.9K 700.6K
View
microsoft-foundry logo
Cloud & Infrastructure

microsoft-foundry

End-to-end deployment, evaluation, and management of AI agents on Microsoft Foundry.

1.5K 630.6K
View
azure-diagnostics logo
Cloud & Infrastructure

azure-diagnostics

Systematic diagnosis and remediation for Azure production issues using AppLens, Monitor, and resource health.

1.5K 620.8K
View
azure-prepare logo
Cloud & Infrastructure

azure-prepare

Prepare Azure applications for deployment with infrastructure-as-code, configuration, and containerization.

1.5K 620.3K
View
azure-ai logo
Cloud & Infrastructure

azure-ai

Unified access to Azure AI services: Search, Speech, OpenAI, and Document Intelligence.

1.5K 620.1K
View
azure-deploy logo
Cloud & Infrastructure

azure-deploy

Execute Azure deployments for prepared applications with built-in error recovery and validation.

1.5K 620K
View
azure-validate logo
Cloud & Infrastructure

azure-validate

Pre-deployment validation for Azure readiness with configuration, infrastructure, RBAC, and identity checks.

1.5K 619.4K
View
azure-storage logo
Cloud & Infrastructure

azure-storage

Unified access to Azure blob storage, file shares, queues, tables, and data lake services.

1.5K 618.9K
View
entra-app-registration logo
Cloud & Infrastructure

entra-app-registration

Microsoft Entra ID app registration, OAuth 2.0 configuration, and MSAL integration for secure application authentication.

1.5K 618.6K
View
appinsights-instrumentation logo
Cloud & Infrastructure

appinsights-instrumentation

Guidance and reference material for instrumenting webapps with Azure Application Insights.

1.5K 618.3K
View
azure-resource-lookup logo
Cloud & Infrastructure

azure-resource-lookup

Fast discovery and inventory of Azure resources across subscriptions using Resource Graph queries.

1.5K 618.3K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View