AnyLumino
API referenceastryxdata

Markdown

Render Markdown content through Astryx.

Astryx Props

JSON-safe Markdown props forwarded to Astryx.

Supported Astryx props include:

  • children (string; required): The markdown string to render.
  • display ('block' or 'inline'): Display type. Markdown defaults to block. Use 'inline' for markdown spans embedded inside text.
  • density ('default' or 'compact'): Controls spacing between block-level elements.
  • headingLevelStart (1 or 2 or 3 or 4 or 5 or 6): The 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): Enables streaming mode; it uses incremental parsing and a smooth fade-in animation for chunk-by-chunk text delivery.
  • onLinkClick ((href: string, event: MouseEvent) => void or false): Handler for link clicks. Return false to prevent the default navigation behavior.
  • 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' or 'number'): How citations are displayed inline. 'label' shows a chip with source title, icon, and border. 'number' shows a compact numbered badge.
  • contentWidth (number or string): Max 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' or 'center'): Alignment of prose content within the container when contentWidth is narrower than the available space.
  • inlinePlugins (MarkdownInlinePlugin[]): Transforms regex matches in parsed text nodes into custom inline React elements. Use for issue refs, diff refs, mentions, and other shorthand patterns. Inline code and fenced code blocks 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.
  • xstyle (StyleXStyles): StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value, not an inline style object like style={{}}.
  • className (string): CSS class name for the root element. Prefer xstyle for styling; className is provided for integration with non-StyleX systems.
  • style (CSSProperties): Inline styles for the root element. Prefer xstyle for styling; inline styles bypass StyleX optimization.
  • data-testid (string): Test selector for automated testing frameworks.

Props typed as React nodes, render functions, event handlers, refs, or StyleX styles are documented for Astryx parity but cannot be serialized directly from Python unless the wrapper adapts them.

See Astryx component docs: https://astryx.atmeta.com/components/Markdown.

Functions

constructor__init__(text, *, display=None, density=None, heading_level_start=None, streaming=None, sources=None, citation_style=None, content_width=None, content_align=None, autolink=None, **props) -> None
paramtextstr

Text content synchronized to the frontend component.

paramdisplaystr | None
= None

Block or inline display.

paramdensitystr | None
= None

Default or compact block spacing.

paramheading_level_startint | None
= None

Heading level corresponding to Markdown #.

paramstreamingbool | None
= None

Whether to use incremental streaming presentation.

paramsourcesMapping[str, Any] | None
= None

Citation sources keyed by identifier.

paramcitation_stylestr | None
= None

Label or numeric citations.

paramcontent_widthint | float | str | None
= None

Maximum prose width.

paramcontent_alignstr | None
= None

Prose alignment inside the available width.

paramautolinkstr | None
= None

Optional GFM bare-link handling.

parampropsAny
= {}

Returns

None

On this page