explaingit

emanuele-web04/remodextextkit

15SwiftAudience · developerComplexity · 3/5ActiveSetup · easy

TLDR

Swift package for rendering rich text and Markdown in SwiftUI with a streaming-friendly view tuned for AI chat output, backed by UIKit under the hood.

Mindmap

mindmap
  root((RemodexTextKit))
    Inputs
      Markdown strings
      Streaming token deltas
      Inline attachments
    Outputs
      Rendered SwiftUI views
      Selectable text
      Animated images
    Use Cases
      AI chat bubbles
      Markdown docs
      Inline math display
    Tech Stack
      Swift
      SwiftUI
      UIKit
      AttributedString

Things people build with this

USE CASE 1

Render a long Markdown message in a SwiftUI chat app without dropping frames while tokens stream in.

USE CASE 2

Replace SwiftUI Text with InlineText to get clickable links, inline images, and selection.

USE CASE 3

Render structured docs with headings, tables, code blocks, and blockquotes styled per block.

USE CASE 4

Plug a custom markup parser into the MarkupParser protocol for a non-Markdown format.

Tech stack

SwiftSwiftUIUIKitAttributedString

Getting it running

Difficulty · easy Time to first run · 30min

Apple platform development requires Xcode and the package is added via Swift Package Manager.

No license terms are stated in the available content, so reuse terms are unclear.

In plain English

RemodexTextKit is a Swift library for showing rich, formatted text inside SwiftUI apps on Apple platforms. The README explains that it grew out of an AI coding app called Remodex, where the assistant streams long answers a few characters at a time, and the standard SwiftUI text view became too slow once messages got long. The package keeps a SwiftUI-friendly public interface but switches to UIKit under the hood for the expensive parts of live rendering, so that scrolling, selecting, and copying stay smooth while a model is still talking. The README frames the project as a spiritual successor to a popular open-source library called MarkdownUI, but redesigned around the idea of a general text rendering engine that happens to support Markdown rather than a Markdown-specific tool. The transformation flow turns markup into attributed content, resolves attachments asynchronously, applies styling through SwiftUI environment values, and uses SwiftUI's normal layout system to position everything on screen. There are three main views to use. InlineText is a drop-in replacement for SwiftUI's Text that supports inline formatting, links, images, and standard SwiftUI modifiers like font and foregroundStyle. StructuredText handles full documents with headings, paragraphs, lists, blockquotes, code blocks, and tables, each block styleable on its own. StreamingText is the path designed for live AI output: it takes the full response so far plus an optional latest delta, and a Boolean flag that flips to false when the response is finished. While streaming, it mutates a UIKit text view directly, coalesces token bursts, caches intrinsic-size measurements, and avoids rebuilding the SwiftUI view tree on every token. The README also lists features like native selection and copy, Markdown parsing through Foundation's AttributedString, inline attachments, math expressions as inline or block items, animated images in GIF, APNG, and WebP formats, syntax highlighting with custom themes, font-relative measurements that scale with accessibility settings, and a MarkupParser protocol so other markup formats can be plugged in. Installation is via Swift Package Manager and the project is on the Swift Package Index.

Copy-paste prompts

Prompt 1
Add RemodexTextKit via Swift Package Manager and wire StreamingText to a Combine publisher that yields token deltas from my AI backend.
Prompt 2
Replace my SwiftUI Text views with InlineText from RemodexTextKit and confirm font and foregroundStyle modifiers still apply.
Prompt 3
Style headings, lists, and code blocks in StructuredText with a custom theme that matches my app brand.
Prompt 4
Implement a MarkupParser conformer that parses MDX-flavoured Markdown for RemodexTextKit.
Prompt 5
Profile streaming token rendering with RemodexTextKit and identify what causes the SwiftUI view tree to rebuild.
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.