Markdown takes a Markdown string and draws it with the same components core's MDX components use on the web. Headings, body text, links, inline code, CodeBlock, quotes, List, Table, Media and Line all look the same as on your site. Use it for content you store as Markdown, such as posts, comments, release notes or help articles.
Pass the source as the child. The parser runs on the device and has no dependencies.
By default, tapping a link opens its URL with Linking.openURL. Pass onLinkPress to route links inside your app instead.
- Blocks: # and underlined headings, paragraphs, fenced code with a language, > quotes, - and 1. lists (nested, and an ordered list keeps its first number), GFM tables with :---: alignment, --- rules, and an image on its own line.
- Inline: **bold**, *italic*, ~~strikethrough~~, `code`, [links](url), <https://…> and bare URLs, and line breaks made with two trailing spaces or a backslash.
To get at the parsed tree, for example to build an excerpt, use parseMarkdown(source) and parseInline(text), which are exported too.
- A string, not MDX. On the web, MDX compiles at build time and can use components as tags. On a phone, Markdown parses plain Markdown when it renders. Raw HTML and MDX tags show up as text.
- No heading anchors. Headings are announced as headers with their level, but they don't get link anchors.
- Images are drawn with Media at full width. An image inside a sentence shows its alt text.
Markdown also takes every Flex prop for its column, such as gap, padding or maxWidth.