markdownComponents
constSource L84Public const export from Markdown Renderer.
const markdownComponents: ComponentsSanitized CommonMark and GFM renderer with safe protocols, prefixed headings, and highlighted code fences.
This is a live example. Interact with the available controls and use the keyboard to inspect the component's states and behavior.
pnpm dlx aq-ui@alpha add markdown-rendererImport the parts you need, then jump to an export for its contract.
import { MarkdownRenderer } from "@/components/ui/markdown-renderer"
<MarkdownRenderer />Public const export from Markdown Renderer.
const markdownComponents: ComponentsSanitized CommonMark and GFM renderer with safe protocols, prefixed headings, and highlighted code fences.
const MarkdownRenderer = React.memo(…)Type contract for MarkdownRendererProps.
interface MarkdownRendererProps extends Omit< React.ComponentProps<"div">, "children" >| Name | Type |
|---|---|
value | string |
components? | Components |
allowHtml? | boolean |
sanitizeSchema? | Schema |
remarkPlugins? | PluggableList |
rehypePlugins? | PluggableList |
Public function export from Markdown Renderer.
const safeMarkdownUrl: UrlTransform| Name |
|---|
url |
key |
code-block, utils
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
aq-ui renders CommonMark with GitHub Flavored Markdown.
Preview content is sanitized before it reaches the page.
| Package | Status |
|---|---|
| Registry | Ready |
| CLI | Ready |
import { Button } from "@/components/ui/button"
export function SaveButton() {
return <Button>Save changes</Button>
}