/superskills-design:swiftui-text-editingfrom Superskills Design
Provides SwiftUI patterns for displaying styled text, building rich text editors with AttributedString, implementing TextEditor with formatting, and rendering Markdown.
Ships in Superskills Design. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Patterns for displaying styled text and building rich text editors in SwiftUI.
Use this skill when the user needs to:
What text task do you need?
|
+-- Display styled text (read-only)
| +-- Simple modifiers -> Text("Hello").bold().foregroundStyle(.blue)
| +-- Mixed styles -> AttributedString
| +-- Markdown -> Text(try! AttributedString(markdown: "**Bold**"))
|
+-- Editable text
+-- Plain text -> TextEditor(text: $text)
+-- Rich/styled text -> TextEditor with AttributedString binding (iOS 18+)
+-- With formatting toolbar -> iOS 18+ AttributedTextFormattingDefinition
| API | Minimum iOS | Notes |
|---|---|---|
Text modifiers (.bold(), .italic()) | iOS 13 | Read-only |
AttributedString | iOS 15 | Rich text model |
Markdown in Text | iOS 15 | Inline Markdown only |
TextEditor(text:) | iOS 14 | Plain text editing |
TextEditor with AttributedString | iOS 18 | Rich text editing |
AttributedTextFormattingDefinition | iOS 18 | Custom formatting constraints |
| Text selection reading | iOS 18 | textEditorSelection |
// Simple modifiers
Text("Hello world")
.font(.headline)
.bold()
.foregroundStyle(.blue)
.italic()
// AttributedString for mixed styles
var attributed = AttributedString("Hello world")
attributed[attributed.range(of: "Hello")!].font = .boldSystemFont(ofSize: 16)
attributed[attributed.range(of: "world")!].foregroundColor = .blue
Text(attributed)
struct RichTextEditor: View {
@State private var text = AttributedString("Start typing...")
@State private var isBold = false
var body: some View {
VStack {
HStack {
Button("B") { isBold.toggle() }
.bold(isBold)
}
TextEditor(text: $text)
}
}
}
// ✅ Works: inline Markdown
Text("**Bold**, _italic_, `code`, [link](https://apple.com)")
// ❌ Does not work in Text: block Markdown
Text("# Heading\n- List items\n> Blockquote")
Text supports only inline Markdown:
**), italic (_), inline code (`), links ([]())For full Markdown rendering, use a third-party library or render to AttributedString first.
| # | Mistake | Fix |
|---|---|---|
| 1 | Using deprecated .foregroundColor() | Use .foregroundStyle() |
| 2 | Missing value: in .animation() | .animation(.default, value: someState) |
| 3 | Expecting full Markdown in Text | Only inline Markdown works; block Markdown requires conversion |
| 4 | Recreating AttributedString every render | Cache it with @State or compute once |
| 5 | Using TextEditor(text:) for rich text | Use AttributedString binding for styled editing (iOS 18+) |
.foregroundStyle() not .foregroundColor()Text actually supportsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub ariadoss/superskills --plugin superskills-design37 skills in this plugin
/adaptive-communicationAdjust communication style based on whether the user is in a relational (exploratory, hedging) or transactional (direct, technical) mode. Use when calibrating response tone, level of scaffolding, or how much to acknowledge context before answering./app-store-screenshotsGenerate App Store and Google Play marketing screenshots using Next.js. Use when the user wants to create app store screenshots, marketing screenshots, or device mockup exports for iOS, iPad, or Android./bencium-code-conventionsBence's code style, tech stack, and workflow conventionsOther plugins' skills for the same job