children | string · requiredThe markdown string to render. |
|---|
display | 'block' | 'inline' · default 'block'Display type. Markdown defaults to block. Use 'inline' for markdown spans embedded inside text. |
|---|
density | 'default' | 'compact' · default 'default'Controls spacing between block-level elements. |
|---|
headingLevelStart | 1 | 2 | 3 | 4 | 5 | 6 · default 1The HTML heading level that markdown # maps to. Shifts all heading levels down to fit the surrounding page hierarchy. Levels exceeding h6 are clamped to h6. |
|---|
isStreaming | boolean · default falseEnables streaming mode; it uses incremental parsing and a smooth fade-in animation for chunk-by-chunk text delivery. |
|---|
onLinkClick | (href: string, event: MouseEvent) => void | falseHandler for link clicks. Return false to prevent the default navigation behavior. Link destinations in the markdown follow the shared navigation rule described on the Link href prop: a blocked destination renders as plain text and never reaches this handler or a custom link renderer. Image URLs use a separate, stricter policy (every data: URL is rejected). |
|---|
sources | Record<string, MarkdownSource>Citation sources keyed by ID. When provided, [id] and 【id】 markers in the markdown that match a key are rendered as citation chips. |
|---|
citationStyle | 'label' | 'number' · default 'label'How citations are displayed inline. 'label' shows a chip with source title, icon, and border. 'number' shows a compact numbered badge. |
|---|
contentWidth | number | string · default 680Max width for prose content (paragraphs, headings, lists, blockquotes). Tables and code blocks are unconstrained and can expand to the full container width. Use for readable line lengths in wide layouts. |
|---|
contentAlign | 'start' | 'center' · default 'start'Alignment of prose content within the container when contentWidth is narrower than the available space. |
|---|
plugins | readonly MarkdownPluginEntry[]Ordered extensions created by createMarkdownPlugin(). Plugins may add bounded syntax, immutable typed AST transforms, and typed extension renderers. Use isMarkdownExtensionNode() to narrow extension data observed from other plugins. Renderer callbacks are pure; return a child component when hooks are needed. Omitted and empty lists preserve the released Markdown behavior. |
|---|
inlinePlugins | MarkdownInlinePlugin[]Transforms regex matches in parsed text nodes into custom inline React elements. Use for prefixed identifiers, mentions, and other shorthand patterns. Inline code, fenced code blocks, and math are unaffected. |
|---|
autolink | 'gfm'Opt-in autolinking of bare URLs and emails. 'gfm' applies GitHub-Flavored Markdown autolink-literal rules: bare https?://..., www...., <scheme:url>, <email>, and user@host all become links. Trailing sentence punctuation and unbalanced trailing close-parens are excluded; matches inside code spans, code blocks, existing links, and image alt text are skipped. Default behavior (option unset) is unchanged. |
|---|
components | MarkdownComponentsCustom React component overrides for rendered Markdown elements (code, inlineCode, math, link, heading, paragraph, image, blockquote, hr, citation). Providing math enables $…$ inline and $$…$$ display parsing and receives {value, display}; omit it when dollar text should stay literal. |
|---|
xstyle | StyleXStylesStyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value, not an inline style object like style={{}}. |
|---|
className | stringCSS class name for the root element. Prefer xstyle for styling; className is provided for integration with non-StyleX systems. |
|---|
style | CSSPropertiesInline styles for the root element. Prefer xstyle for styling; inline styles bypass StyleX optimization. |
|---|
data-testid | stringTest selector for automated testing frameworks. |
|---|