Skip to content
aq-ui
Back to EditorsEditor

Markdown Renderer

Sanitized CommonMark and GFM renderer with safe protocols, prefixed headings, and highlighted code fences.

Preview

This is a live example. Interact with the available controls and use the keyboard to inspect the component's states and behavior.

Loading interactive preview…

Installation

pnpm dlx aq-ui@alpha add markdown-renderer

API reference

SSR-safe

Import the parts you need, then jump to an export for its contract.

View full source

Quick start

import { MarkdownRenderer } from "@/components/ui/markdown-renderer"

<MarkdownRenderer />

markdownComponents

constSource L84

Public const export from Markdown Renderer.

const markdownComponents: Components

MarkdownRenderer

constSource L338

Sanitized CommonMark and GFM renderer with safe protocols, prefixed headings, and highlighted code fences.

const MarkdownRenderer = React.memo(…)
<MarkdownRenderer />

MarkdownRendererProps

interfaceSource L20

Type contract for MarkdownRendererProps.

interface MarkdownRendererProps extends Omit< React.ComponentProps<"div">, "children" >

Members

NameType
valuestring
components?Components
allowHtml?boolean
sanitizeSchema?Schema
remarkPlugins?PluggableList
rehypePlugins?PluggableList

safeMarkdownUrl

functionSource L61

Public function export from Markdown Renderer.

const safeMarkdownUrl: UrlTransform

Parameters

Name
url
key

Registry dependencies

code-block, utils

Package dependencies

hast-util-sanitize@^5.0.2, react-markdown@^10.1.0, rehype-raw@^7.0.0, rehype-sanitize@^6.0.0, remark-gfm@^4.0.1, unified@^11.0.5

Files

  • components/ui/markdown-renderer.tsx

Source