Markdown

The markdown component renders a string in the CommonMark standard. It also supports LaTeX (through MathJax), with remark-math and rehype-mathjax. Other plugins and markdown components are not supported. The markdown is wrapped in a View, which all props are passed to except for children.

For individual lines of text, consider using ui.text and ui.heading instead.

Example

Markdown Basic Example

LaTeX

When writing LaTeX, be careful how Python handles backslashes with escape characters. To minimize this issue, it is recommended to use raw strings.

Container Style

Markdown is automatically wrapped in a View, which all props except children are passed to.

API Reference

View is a general purpose container with no specific semantics that can be used for custom styling purposes. It supports Spectrum style props to ensure consistency with other Spectrum components.

Returns: Element The rendered view.

ParametersTypeDefaultDescription
childrenstrThe markdown string.
element_typeLiteral['div', 'button', 'a'] |
None
NoneThe type of element to render.
keystr |
None
NoneA unique identifier used by React to render elements in a list.