Loading...
Loading...
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.
npx skill4agent add vercel/streamdown streamdownreact-markdownnpm install streamdownnpm install @streamdown/code @streamdown/mermaid @streamdown/math @streamdown/cjkglobals.css@source "../node_modules/streamdown/dist/*.js";tailwind.config.jsmodule.exports = {
content: [
"./app/**/*.{js,ts,jsx,tsx,mdx}",
"./node_modules/streamdown/dist/*.js",
],
};import { Streamdown } from 'streamdown';
<Streamdown>{markdown}</Streamdown>'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>
</>
);
}<Streamdown mode="static" plugins={{ code }}>
{content}
</Streamdown>| Prop | Type | Default | Purpose |
|---|---|---|---|
| | — | Markdown content |
| | | Rendering mode |
| | — | Feature plugins |
| | | Streaming indicator |
| | — | Cursor style |
| | — | Custom element overrides |
| | | Interactive buttons |
| | | Link confirmation modal |
| | | Code themes |
| | — | Container class |
| Plugin | Package | Purpose |
|---|---|---|
| Code | | Syntax highlighting (Shiki, 200+ languages) |
| Mermaid | | Diagrams (flowcharts, sequence, etc.) |
| Math | | LaTeX via KaTeX (requires CSS import) |
| CJK | | Chinese/Japanese/Korean text support |
import 'katex/dist/katex.min.css';assets/examples/@sourcecontentnode_modules/streamdown/dist/*.jskatex/dist/katex.min.csscaretisAnimating={true}isAnimating={true}linkSafety={{ enabled: false }}shikitranspilePackagesallowedTags$$$