Swift package
Markdown that belongs in SwiftUI.
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.
Latest stable release
3.1.0
Published via Git tag
Swift Package Manager: from: "3.1.0"
Markdown in the view hierarchy
import SwiftUI
import MarkdownUI
struct NotesView: View {
var body: some View {
MarkdownView("""
## Ship notes
MarkdownUI renders **GitHub Flavored Markdown** in SwiftUI.
""")
}
}
Rendered result: Ship notes
MarkdownUI renders rich text with native SwiftUI views.
- Headings and links
- Task lists and tables
- Inline code and fenced blocks
Apply a theme, then override only the styles you need.
What it renders
The Markdown people put in real app content.
MarkdownUI handles headings, styled text, links, images, bullet and numbered lists, task lists, blockquotes, code blocks, tables, and thematic breaks.
Platform requirements
- macOS 15.0+
- iOS 17.0+, tvOS 17.0+, and Mac Catalyst 17.0+
- watchOS 10.0+ and visionOS 2.0+
How it is built
A SwiftUI renderer with GitHub Flavored Markdown at its core.
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
Start with the pieces you will use.
Getting started — Create a MarkdownView from a string, a content builder, or pre-parsed MarkdownContent.
API documentation — Read the generated DocC documentation for MarkdownUI types and modifiers.
Examples — See MarkdownView, content builders, and theme changes in focused Swift snippets.
Ready to add it?
Start with a MarkdownView, then make it yours.
MarkdownUI is an open-source Swift package.