A Swift library for creating beautiful, easy attributed strings with support for iOS, macOS, tvOS, and watchOS.
BonMot is a Swift library for creating and managing attributed strings across Apple platforms like iOS, macOS, tvOS, and watchOS. It simplifies the process of styling text by providing a declarative API that handles fonts, colors, spacing, OpenType features, and dynamic type, freeing developers from the low-level complexities of Core Text and NSAttributedString.
iOS, macOS, tvOS, and watchOS developers who need to create rich, styled text interfaces with support for localization, accessibility, and responsive typography.
Developers choose BonMot for its clean Swift API, extensive feature set (XML parsing, image attachments, vertical alignment), and seamless integration with Interface Builder and Dynamic Type, reducing the boilerplate and complexity of working with attributed strings.
Beautiful, easy attributed strings in Swift
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers a clean, type-safe way to style strings with StringStyle, reducing boilerplate compared to raw NSAttributedString usage.
Allows dynamic formatting of localized strings using custom XML tags, making it easy to style mixed-content text across languages.
Automatically adapts text to system content size categories with .adapt() and .control/.body scaling, improving accessibility out-of-the-box.
Supports registering global named styles that can be applied visually in Storyboards via IBInspectable, streamlining design workflows.
BonMot 4+ is Swift-native, and Objective-C interoperability requires workarounds like named styles or downgrading to BonMot 3.2.
With Apple's AttributedString introduced in iOS 15, BonMot may be redundant for new projects targeting only recent OS versions.
TextAlignmentConstraint holds strong references to UI elements, which can cause memory leaks if not carefully managed, as warned in the README.