Getting started
Create a MarkdownView from a string, a content builder, or pre-parsed MarkdownContent.
Read moreSwift package
MarkdownUI parses GitHub Flavored Markdown and renders it with native SwiftUI views. Use the built-in themes, or tune text and block styles for your app.
SwiftUI
import SwiftUI
import MarkdownUI
struct NotesView: View {
var body: some View {
MarkdownView("""
## Ship notes
MarkdownUI renders **GitHub Flavored Markdown** in SwiftUI.
""")
}
}Rendered result
MarkdownUI renders rich text with native SwiftUI views.
Inline code and fenced blocksApply a theme, then override only the styles you need.
What it renders
MarkdownUI handles headings, styled text, links, images, bullet and numbered lists, task lists, blockquotes, code blocks, tables, and thematic breaks.
Platform requirements
How it is built
MarkdownUI is maintained in the modern-swift-dev/swift-markdown-ui repository. The package targets the GitHub Flavored Markdown specification and depends on Swift CMark's cmark-gfm and cmark-gfm-extensions products for parsing.
Documentation
Create a MarkdownView from a string, a content builder, or pre-parsed MarkdownContent.
Read moreRead the generated DocC documentation for MarkdownUI types and modifiers.
Read moreSee MarkdownView, content builders, and theme changes in focused Swift snippets.
Read moreReady to add it?