Skip to content

Components · Reference

Markdown

A Bun Markdown compiler and shared React renderer with safe links, extracted code blocks, and TanStack Highlight.

Last updated October 18, 2026

Overview

markdown provides a server-side Bun.markdown compiler and a matching React renderer. The compiler escapes raw HTML, restricts link and image URLs, and extracts fenced code for rendering through the shared CodeBlock.

Install

shell
bunx shadcn@latest add @krak-stack/markdown

Usage

tsx
const compiled = compileMarkdown(source);

<MarkdownContent
  html={compiled.html}
  codeBlocks={compiled.codeBlocks}
/>
Dependencies
Packages and shadcn components required by this registry item.