attributed-string

Create and style attributed strings with inline and paragraph attributes in SwiftUI.

1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/venomez-viper/PathWise --skill attributed-string-venomez-viper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: attributed-string
Source: https://github.com/venomez-viper/PathWise/tree/main/.claude/skills/foundation/attributed-string
Command: npx skills add https://github.com/venomez-viper/PathWise --skill attributed-string-venomez-viper

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Working with rich text and styled attributes in SwiftUI can be verbose and error‑prone; AttributedString provides a modern, type‑safe approach but requires proper patterns to apply inline and paragraph attributes.

Core Features & Use Cases

  • Creating and applying inline attributes (font, color, underline) and paragraph styles
  • Managing writing direction, alignment, and line height for multi‑line content
  • SwiftUI integration with Text and TextEditor for live rich text editing and display, including handling ranges and selections

Quick Start

Create a simple AttributedString with bold title and colored body in a SwiftUI Text view.

Frequently Asked Questions about attributed-string

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply inline attributes like font and color to an AttributedString in SwiftUI?

To apply inline attributes to an AttributedString in SwiftUI, use type-safe API patterns to assign font, color, and underline styles directly to specific text ranges. This approach ensures safe attribute application and prevents verbose, error-prone styling code.

Can I use AttributedString with a SwiftUI TextEditor for live rich text editing?

Yes, AttributedString works with SwiftUI TextEditor for live rich text editing and display. You can handle text selections and manage ranges within the editor to support dynamic styling and non-contiguous substring manipulation across iOS and macOS.

What's the best way to manage paragraph styles and line height in SwiftUI rich text?

The best way to manage paragraph styles in SwiftUI rich text is by applying paragraph-level attributes directly to AttributedString. This workflow supports text alignment, writing direction, and line height adjustments for multi-line content using safe API patterns.

How do discontiguous substrings work when styling rich text in SwiftUI?

Discontiguous substrings in SwiftUI allow you to select and style non-contiguous text ranges within an AttributedString. This enables applying inline attributes like font or color to multiple separate text segments simultaneously without affecting the entire string.

Does SwiftUI AttributedString support writing direction and text alignment across iOS and macOS?

Yes, SwiftUI AttributedString supports writing direction and text alignment across both iOS and macOS. The workflow provides clear API usage patterns to manage multi-line content layout, ensuring proper compatibility and safe attribute application on both platforms.