by microsoft
A performant markdown library for iOS & macOS that supports streaming
# Add to your Claude Code skills
git clone https://github.com/microsoft/SwiftStreamingMarkdownGuides for using ai agents skills like SwiftStreamingMarkdown.
Last scanned: 6/14/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-06-14T08:16:37.067Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}SwiftStreamingMarkdown is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by microsoft. A performant markdown library for iOS & macOS that supports streaming. It has 281 GitHub stars.
Yes. SwiftStreamingMarkdown passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/microsoft/SwiftStreamingMarkdown" and add it to your Claude Code skills directory (see the Installation section above).
SwiftStreamingMarkdown is primarily written in Swift. It is open-source under microsoft on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh SwiftStreamingMarkdown against similar tools.
No comments yet. Be the first to share your thoughts!
An iOS and macOS Markdown renderer that offers smooth streaming experiences.
Here are a few demos to help you quickly understand this library's capabilities. More can be found in the sample app.
The renderer targets the subset of CommonMark + GitHub-flavored Markdown that LLM responses actually emit. Unsupported syntax degrades to readable text so streamed responses never break.
# … ######)) — block-level, opt-in via the experimental ImageConfig (remote-allowlist, asset-catalog, and bundled-resource sources; tap to open the built-in fullscreen viewer)Inline code- [ ] / - [x]), display-only---):---, :---:, ---: column alignment\( … \)$$ … $$[^1])==text==), superscript (^x^), subscript (~x~)<details>, <kbd>, <aside>, …) — kept inline as text> [!NOTE]) — rendered as plain block quotes::: warning … :::) and admonitions (!!! note)The bundled Kitchen Sink demonstration in the sample app exercises every item above so you can verify the fallback behavior on-device.
SwiftStreamingMarkdown includes built-in animations for streaming content as new text arrives. It is designed to keep rendering smooth while minimizing main-thread work. The chart below compares its performance against popular Markdown libraries that do not provide built-in streaming support.
Profiling was performed on an iPhone XS using the sample app while continuously streaming content and scrolling. Even under this demanding workload on older hardware, SwiftStreamingMarkdown maintains smooth rendering without noticeable UI stalls.
SwiftStreamingMarkdown is distributed exclusively as a Swift Package.
https://github.com/microsoft/SwiftStreamingMarkdownSwiftStreamingMarkdown product to your app target.Package.swift.package(url: "https://github.com/microsoft/SwiftStreamingMarkdown", from: "0.1.0"),
.target(
name: "MyApp",
dependencies: [
.product(name: "SwiftStreamingMarkdown", package: "SwiftStreamingMarkdown")
]
)
Integrating SwiftStreamingMarkdown adds approximately 1 MB to your app's App Store download size. The increase comes from the rendering engine and its dependencies (swift-markdown, cmark-gfm, iosMath for LaTeX, HighlightSwift for code syntax highlighting) and bundled resources (math font, syntax-highlighting theme). Actual size varies with architecture slices and App Store compression.
The simplest entry point is MarkdownView, which parses and renders a static
string of Markdown using the default theme:
import SwiftUI
import SwiftStreamingMarkdown
struct ContentView: View {
var body: some View {
ScrollView {
MarkdownView(text: """
# Hello, **world!**
SwiftStreamingMarkdown supports tables, lists, code blocks, and
inline `code`.
```swift
print("Hello, world!")
```
""")
.padding()
}
}
}
For chat-style UIs that grow the Markdown source over time, use
StreamedMarkdownView. It takes a StreamedMarkdownSource whose text
property yields progressively larger snapshots of the Markdown source (each
emission is the full source so far, not a delta) and incrementally parses
and renders them as they arrive.
import SwiftUI
import SwiftStreamingMarkdown
class ChatResponseSource: ObservableObject, StreamedMarkdownSource {
var text: AsyncStream<String> { ... }
}
struct ChatBubble: View {
@EnvironmentObject var source: ChatResponseSource
var body: some View {
StreamedMarkdownView(source: source)
}
}
If you'd rather drive DocumentView directly, parse each snapshot with
MarkdownParser.parse(text:config:) and feed the resulting
RenderableDocument into your view yourself.
The bundled sample app demonstrates
chunked streaming end-to-end with adjustable chunk size and interval, plus
auto-scroll wired through a MarkdownListener.
MarkdownRenderConfig is the single source of truth for styling. Build one
by composing the withXxx helpers on .default:
let config = MarkdownRenderConfig.default
.withShouldAnimateText(value: true)
.withHeadingStyle(value: MarkdownRenderConfig.defaultHeadingStyle)
.withParagraphStyle(value: MarkdownRenderConfig.defaultParagraphStyle)
For finer control, construct MarkdownRenderConfig directly to override the
inline, paragraph, heading, list, table, and citation styles in one place.
Conform to MarkdownListener to receive notifications whenever the renderer
draws or the user interacts with rendered content (table copy/download taps,
context-menu lifecycle, etc.):
final class AnalyticsListener: MarkdownListener {
func onRender(markdown: RenderableDocument) async { /* ... */ }
func onTableCopyTap(content: String) async { /* ... */ }
func onTableDownloadTap(content: String) async { /* ... */ }
func onContextMenuAppear(id: String, selectedContent: String) async { /* ... */ }
func onContextMenuTap(id: String, selectedContent: String) async { /* ... */ }
}
MarkdownView(text: source, listener: AnalyticsListener())
The listener is propagated through the SwiftUI environment, so deeply nested rendered subviews observe the same hooks.
A SwiftUI sample app lives in
Examples/SwiftStreamingMarkdownSample.
It includes a streaming demonstration with adjustable chunk size and interval,
a settings screen, and a logging MarkdownListener implementation. The sample
Xcode proje