About
A lightweight component that renders markdown text (headings, lists, inline code, links, bold) as styled JSX without any parser dependency.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Markdown Preview to your project and fits it to your theme.
Code
How Markdown Preview is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import { MarkdownPreview } from "@/components/ui/markdown-preview";
const sample = `# Release Notes
## Highlights
- Faster build pipeline with incremental caching
- New **dark mode** toggle for every page
- Fixed a bug where \`npm install\` failed on Windows
## Example
\`\`\`
npm install your-package
npm run build
\`\`\`
Read the full [migration guide](https://example.com/docs) before upgrading.
`;
export default function MarkdownPreviewDemo() {
return (
<div className="w-full max-w-xl rounded-lg border border-border bg-background p-6 text-foreground">
<MarkdownPreview source={sample} />
</div>
);
}
















