翻篇收录说明
翻篇网页快照

Getting Started

https://streamdown.ai/docs/getting-started

最近抓取:2026-12-04 02:59:23(北京时间)

最近内容变化:2026-12-01 00:14:23(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Learn how to install and configure Streamdown in your React application.

正文摘录

MenuGetting StartedCopy for LLMView MarkdownAsk AI about this pageGet up and running with Streamdown in minutes. This guide will walk you through installation, configuration, and your first implementation. Requirements Node.js >= 18 React >= 19.1.1 (compatible with React 18+) Tailwind CSS (for styling) Installation You can install Streamdown directly, or use it as part of the AI Elements library. Direct Installation Install Streamdown using your preferred package manager: npmpnpmyarnbunnpm i streamdown AI Elements Install the message component from AI Elements: npmpnpmyarnbunnpx ai-elements@latest add message Tailwind CSS Configuration Streamdown uses Tailwind CSS for styling. To ensure the styles are properly applied, you need to configure your Tailwind setup to include Streamdown's source files. Tailwind v4 Add the following CSS source directive to your globals.css or main CSS file: globals.css@source "../node_modules/streamdown/dist/*.js"; The path must be relative from your CSS file to the node_modules folder containing streamdown. In a standard Next.js project where globals.css lives in app/, the default path above should work. If you install optional plugins, add their matching @source lines only for packages you've installed. See the plugin pages for exact paths and examples: Code: /docs/plugins/code CJK: /docs/plugins/cjk Math: /docs/plugins/math Mermaid: /docs/plugins/mermaid Example: to include the code plugin, add this to globals.css (adjust the relative path as needed): globals.css@source "../node_modules/@streamdown/code/dist/*.js"; Animation styles If you're using the built-in animated prop for streaming animation, import the animation CSS in your app: app/layout.tsximport "streamdown/styles.css"; Monorepo setup In a monorepo (npm workspaces, Turbo, pnpm, etc.), dependencies are typically hoisted to the root node_modules. You need to adjust the relative path to point there: monorepo/ ├── node_modules/streamdown/ ← hoisted here ├── apps/ │ └── web/ │ └── app/ │ └── globals.css ← your CSS file globals.css/* apps/web/app/globals.css → 3 levels up to reach root node_modules */ @source "../../../node_modules/streamdown/dist/*.js"; Adjust the number of ../ segments based on where your CSS file lives relative to the root node_modules. Tailwind v3 Add Streamdown to your content array in your tailwind.config.js: tailwind.config.jsmodule.exports = { content: [ "./app/**/*.{js,ts,jsx,tsx,mdx}", "./node_modules/streamdown/dist/*.js", ], // ... rest of your config }; In a monorepo, adjust the path to reach the root node_modules: tailwind.config.jsmodule.exports = { content: [ "./app/**/*.{js,ts,jsx,tsx,mdx}", "../../node_modules/streamdown/dist/*.js", ], // ... rest of your config };PreviousIntroductionNextUsage