AI Streaming Markdown
Renders a markdown answer as it streams: each word fades up out of a blur, with headings, lists, bold and inline code formatted as they arrive.
aistreamingmarkdowntextfade
Installation
Run the shadcn CLI in a project with Tailwind CSS. The component lands in components/pixelpapa/ai-streaming-markdown.tsx.
$pnpm dlx shadcn@latest add "https://pixelpapa.com/r/ai-streaming-markdown.json"Manual install+
1. Install the dependencies.
$pnpm add lucide-react motion2. Copy the code from the Code tab above into your project. It imports the cn helper from @/lib/utils, which every shadcn project already has.
Build it with AI
Prefer to let an agent do the wiring? Copy this prompt, describe where the component should go, and paste.
AI prompt
Paste into Claude, Cursor, v0 or Lovable
Add the "AI Streaming Markdown" component from PixelPapa UI to this project. What it is: Renders a markdown answer as it streams: each word fades up out of a blur, with headings, lists, bold and inline code formatted as they arrive. Category: AI Elements. Depends on: lucide-react, motion. 1. Install it with the shadcn CLI: npx shadcn@latest add "https://pixelpapa.com/r/ai-streaming-markdown.json" (If the CLI is unavailable, fetch that URL, write files[0].content to components/pixelpapa/ai-streaming-markdown.tsx and install the listed dependencies.) 2. Import it from "@/components/pixelpapa/ai-streaming-markdown" and place it where I describe below. 3. Keep its animation timings and accessibility attributes. Replace the demo copy and data with content that fits my product, and use my existing theme tokens (bg-background, text-foreground, bg-primary, border-border) rather than hard-coded colours. Where to use it: <describe the page and position here>
More ai elements
- AI Chat ThreadA chat thread where user bubbles spring in from the right and the assistant reply streams in chunks behind a blinking caret, auto-scrolling as it grows.
- AI Code Block With CopyA code answer with sliding language tabs, line numbers, highlighted lines that wipe in, and a copy button that morphs into a confirmed tick.
- AI Model CompareA blind side-by-side: two answers stream at their own speeds with live token stats, then your vote crowns a winner and reveals both model names.
- AI Prompt InputA chat composer with an auto-growing textarea, removable attachment chips, a model picker popover and a send button that morphs into stop while generating.
- AI Source CitationsAn answer with numbered citation markers; hovering or focusing one pops a source card and lights the matching source in the strip below.
- AI Suggestion ChipsPrompt suggestions grouped by intent; chips cascade in when you switch group, and picking one types its prompt into the input.