{"id":15038621,"url":"https://github.com/danielsaidi/richtextkit","last_synced_at":"2025-10-08T12:29:43.502Z","repository":{"id":37932058,"uuid":"490816086","full_name":"danielsaidi/RichTextKit","owner":"danielsaidi","description":"RichTextKit is a Swift SDK that helps you use rich text in Swift and SwiftUI.","archived":false,"fork":false,"pushed_at":"2025-04-04T14:29:23.000Z","size":6751,"stargazers_count":1072,"open_issues_count":56,"forks_count":133,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-05T19:06:41.469Z","etag":null,"topics":["appkit","ios","macos","rich-text","rich-text-editor","swift","swiftui","tvos","uikit","watchos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielsaidi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["danielsaidi"]}},"created_at":"2022-05-10T18:28:15.000Z","updated_at":"2025-04-05T12:03:08.000Z","dependencies_parsed_at":"2023-10-12T21:17:51.347Z","dependency_job_id":"0eb6c2ba-5e7f-46d1-9b05-a6b5f180ae53","html_url":"https://github.com/danielsaidi/RichTextKit","commit_stats":{"total_commits":638,"total_committers":21,"mean_commits":30.38095238095238,"dds":0.2068965517241379,"last_synced_commit":"9d091e12d50c62d29fe99d2cdb901e31cb6dac1a"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsaidi%2FRichTextKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsaidi%2FRichTextKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsaidi%2FRichTextKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsaidi%2FRichTextKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielsaidi","download_url":"https://codeload.github.com/danielsaidi/RichTextKit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631668,"owners_count":21136554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appkit","ios","macos","rich-text","rich-text-editor","swift","swiftui","tvos","uikit","watchos"],"created_at":"2024-09-24T20:39:18.037Z","updated_at":"2025-10-08T12:29:43.496Z","avatar_url":"https://github.com/danielsaidi.png","language":"Swift","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"Resources/Icon.png\" alt=\"Project Icon\" width=\"250\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/release/danielsaidi/RichTextKit?color=%2300550\u0026sort=semver\" alt=\"Version\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Swift-5.9-orange.svg\" alt=\"Swift 5.9\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/platform-SwiftUI-blue.svg\" alt=\"Swift UI\" title=\"Swift UI\" /\u003e\n    \u003ca href=\"https://danielsaidi.github.io/RichTextKit\"\u003e\u003cimg src=\"https://img.shields.io/badge/documentation-web-blue.svg\" alt=\"Documentation\" /\u003e\u003c/a\u003e\n        \u003ca href=\"https://github.com/danielsaidi/RichTextKit/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/danielsaidi/RichTextKit\" alt=\"MIT License\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/sponsors/danielsaidi\"\u003e\u003cimg src=\"https://img.shields.io/badge/sponsor-GitHub-red.svg\" alt=\"Sponsor my work\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n\n# RichTextKit\n\nRichTextKit is a library that lets you view and edit rich text in Swift and SwiftUI, on all major Apple platforms.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"Resources/Demo.jpg\" /\u003e\n\u003c/p\u003e\n\nThe `RichTextEditor` supports text styles (bold, italic, underline, etc.), fonts, font sizes, colors, text alignments, image attachments, and much more. It's powered by a `RichTextView` that bridges `UITextView` \u0026 `NSTextView` and adds additional, platform-agnostic APIs that make the two views behave more alike.\n\nIf you just want to view rich text content, you can use the `RichTextViewer` SwiftUI view, which wraps the editor and applies a read-only configuration to it.\n\n\n## ‼️ Important ‼️ \n\nThis repository was created a few years ago, when SwiftUI had limited support for rich text. Since then, SwiftUI has received more support for attributed strings. And with the new iOS/macOS 26 releases, we can now edit attributed strings with a `TextEditor`.\n\nThis brings into questions how much value this repository will bring over time. It will most likely not be updated in its current direction, since most of its complexities to integrate between SwiftUI \u0026 UIKit/AppKit will not be needed.\n\nIt will most probably still be relevant to perform operations on the attributed string, and perhaps provide control panels, etc. Regardless, things will be different, so I am not yet sure if I will keep this library alive after the WWDC 25 announcements. Feel free to reach out to discuss this with me.\n\nBest regards, Daniel Saidi\n\n\n\n## Installation\n\nRichTextKit can be installed with the Swift Package Manager:\n\n```\nhttps://github.com/danielsaidi/RichTextKit.git\n```\n\n\n## Support My Work\n\nYou can [become a sponsor][Sponsors] to help me dedicate more time on my various [open-source tools][OpenSource]. Every contribution, no matter the size, makes a real difference in keeping these tools free and actively developed.\n\n\n\n## Getting started\n\nRichTextKit has a SwiftUI ``RichTextEditor`` that takes a text binding and a ``RichTextContext``:\n\n```swift\nstruct MyView: View {\n\n    @State\n    private var text = NSAttributedString(string: \"Type here...\")\n    \n    @StateObject\n    var context = RichTextContext()\n\n    var body: some View {\n        RichTextEditor(text: $text, context: context) {\n            // You can customize the native text view here\n        }\n        .focusedValue(\\.richTextContext, context)\n    }\n}\n```\n\nThe editor uses a ``RichTextCoordinator`` to sync changes between the editor, context, and platform-specific view. You can use the context to change font, colors, alignment etc. and observe context changes to update the UI.\n\nIf you just want to display rich text, you can use the ``RichTextViewer`` instead:\n\n```swift\nstruct MyView: View {\n\n    private var text = NSAttributedString(...)\n\n    var body: some View {\n        RichTextViewer(text: text)\n    }\n}\n```\n\nRichTextKit provides UI components, keyboard shortcuts \u0026 menu commands that can be used in a rich text editor.\n\nFor more information, please see the [getting started guide][Getting-Started].\n\n\n\n## Documentation\n\nThe [online documentation][Documentation] has more information, articles, code examples, etc.\n\n\n\n## Demo App \u0026 Inspiration\n\nThe RichTextKit demo lets you explore the library on iOS \u0026 macOS. To try it out, just open and run the `Demo` app.\n\nRichTextKit is also used in the following apps, so make sure to check them out for inspiration:\n\n\u003ca title=\"Chunk\" href=\"https://www.chunkapp.com\"\u003e\u003cimg src=\"Resources/apps/chunk.png\" width=100 /\u003e\u003c/a\u003e \n\u003ca title=\"Oribi Writer\" href=\"https://oribi.se/en\"\u003e\u003cimg src=\"Resources/apps/oribiwriter.png\" width=100 /\u003e\u003c/a\u003e\n\nDon't hesitate to reach out if you are using RichTextKit, and want to add your app to this list. I'd love to feature it.\n\n\n\n## Contact\n\nFeel free to reach out if you have questions or want to contribute in any way:\n\n* Website: [danielsaidi.com][Website]\n* E-mail: [daniel.saidi@gmail.com][Email]\n* Bluesky: [@danielsaidi@bsky.social][Bluesky]\n* Mastodon: [@danielsaidi@mastodon.social][Mastodon]\n\n\n\n## License\n\nRichTextKit is available under the MIT license. See the [LICENSE][License] file for more info.\n\n\n\n[Email]: mailto:daniel.saidi@gmail.com\n[Website]: https://danielsaidi.com\n[GitHub]: https://github.com/danielsaidi\n[OpenSource]: https://danielsaidi.com/opensource\n[Sponsors]: https://github.com/sponsors/danielsaidi\n\n[Bluesky]: https://bsky.app/profile/danielsaidi.bsky.social\n[Mastodon]: https://mastodon.social/@danielsaidi\n[Twitter]: https://twitter.com/danielsaidi\n\n[Documentation]: https://danielsaidi.github.io/RichTextKit/\n[Getting-Started]: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/getting-started\n[License]: https://github.com/danielsaidi/RichTextKit/blob/master/LICENSE\n","funding_links":["https://github.com/sponsors/danielsaidi"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielsaidi%2Frichtextkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielsaidi%2Frichtextkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielsaidi%2Frichtextkit/lists"}