Connect with us


MarkdownUI – Render Markdown text in SwiftUI

MarkdownUI is a Swift package for rendering Markdown in SwiftUI, fully compliant with the CommonMark Spec.

Supported Platforms

You can use MarkdownUI in the following platforms:

  • macOS 11.0+
  • iOS 14.0+
  • tvOS 14.0+


You can create a Markdown view by providing a Markdown-formatted string.

Markdown("You can try **CommonMark** [here](")

Markdown text

If you have already parsed a Markdown-formatted string into a CommonMark document, you can initialize a Markdown view with it.

let document = try! Document(
  markdown: "You can try **CommonMark** [here]("

var body: some View {

Alternatively, you can use an embedded DSL to describe the content of a Markdown view.

Markdown {
  Heading(level: 2) {
    "Markdown lists"
  OrderedList {
  BulletList {
    "Start a line with a star"

MarkdownUI installation

You can add MarkdownUI to an Xcode project by adding it as a package dependency.

  1. From the File menu, select Add Packages…
  2. Enter into the Search or Enter Package URL search field
  3. Link MarkdownUI to your application target
MarkdownUI on GitHub:
Platform: iOS
⭐️: 766