Requirements
- Node.js >= 18
- React >= 18
- Tailwind CSS
Installation
Configure Tailwind CSS
Streamdown uses Tailwind CSS utility classes internally. Add a The path must be relative from your CSS file to the Tailwind v3: Add the path to your
@source directive to your globals.css so Tailwind scans Streamdown’s built output:globals.css
node_modules folder containing streamdown. In a standard Next.js project where globals.css lives in app/, the path above works as-is.If you install optional Streamdown plugins (
@streamdown/code, @streamdown/math, etc.), add a matching @source line for each one. See the individual plugin pages for exact paths.content array in tailwind.config.js instead:tailwind.config.js
Set up animation styles
If you plan to use the built-in
animated prop for streaming animations, import the animation stylesheet in your app’s root layout:app/layout.tsx
Add CSS custom properties
Streamdown components are built on the shadcn/ui design system and rely on CSS custom properties for colors, border radius, and spacing.If you already use shadcn/ui, these variables are set up automatically. Otherwise, add the following minimal set to your global CSS:Without these variables, components may render with missing backgrounds, incorrect borders, or broken spacing.
globals.css
Monorepo setup
In a monorepo (npm workspaces, Turborepo, pnpm workspaces, etc.), dependencies are typically hoisted to the rootnode_modules. The @source path must point there instead of a local node_modules.
Given this structure:
../ segments to reach the root:
globals.css
node_modules directory and add the appropriate number of ../ segments. Apply the same adjustment for any plugin @source entries.
For Tailwind v3 in a monorepo, update tailwind.config.js similarly:
tailwind.config.js
