{"id":16107613,"url":"https://github.com/n3d1117/expandabletext","last_synced_at":"2025-04-12T22:55:15.203Z","repository":{"id":107065512,"uuid":"606440302","full_name":"n3d1117/ExpandableText","owner":"n3d1117","description":"App Store-like SwiftUI expandable text view with \"more\" button, iOS 13+, fully customizable","archived":false,"fork":false,"pushed_at":"2024-07-10T09:19:27.000Z","size":26,"stargazers_count":59,"open_issues_count":5,"forks_count":16,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T22:55:10.590Z","etag":null,"topics":["ios","swift","swiftui","swiftui-text","xcode"],"latest_commit_sha":null,"homepage":"https://edoardo.fyi/blog/2022/07/swiftui-expandable-text/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/n3d1117.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2023-02-25T13:58:52.000Z","updated_at":"2025-04-02T05:13:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8b52be3-2646-45e8-b86f-c8408dccbdaf","html_url":"https://github.com/n3d1117/ExpandableText","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n3d1117%2FExpandableText","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n3d1117%2FExpandableText/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n3d1117%2FExpandableText/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n3d1117%2FExpandableText/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n3d1117","download_url":"https://codeload.github.com/n3d1117/ExpandableText/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643050,"owners_count":21138353,"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":["ios","swift","swiftui","swiftui-text","xcode"],"created_at":"2024-10-09T19:23:51.668Z","updated_at":"2025-04-12T22:55:15.194Z","avatar_url":"https://github.com/n3d1117.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExpandableText\n[![build](https://github.com/n3d1117/ExpandableText/actions/workflows/build.yml/badge.svg)](https://github.com/n3d1117/ExpandableText/actions/workflows/build.yml)\n[![swift-version](https://img.shields.io/badge/swift-5.7-orange.svg)](https://github.com/apple/swift/)\n[![ios-version](https://img.shields.io/badge/ios-13.0+-brightgreen.svg)](https://github.com/apple/ios/)\n[![xcode-version](https://img.shields.io/badge/xcode-14.2-blue)](https://developer.apple.com/xcode/)\n[![license](https://img.shields.io/badge/license-The%20Unlicense-yellow.svg)](LICENSE)\n\nAn expandable text view that displays a truncated version of its contents with a \"more\" button that expands the view to show the full contents.\n\niOS 13+ compatible, fully customizable, written in SwiftUI.\n\n## Installation\nAvailable via the [Swift Package Manager](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app). Requires iOS 13+.\n\n```\nhttps://github.com/n3d1117/ExpandableText\n```\n\n## Features\n- Customizable line limit\n- Customizable font, color, and `more` button appearance with SwiftUI-like modifiers\n- Automatically hide `more` button if the whole text fits within the view\n- Support right-to-left languages\n- Support re-collapsing text by tapping on expanded text body (by [@JThramer](https://github.com/JThramer))\n- Support custom expand animation\n- Automatically trim multiple new lines when truncated (can be disabled)\n\n## Usage\n\n### Basic usage\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n```swift\nimport ExpandableText\n\nlet loremIpsum = \"\"\"\nLorem ipsum dolor sit amet, consectetur adipiscing \nelit, sed do eiusmod tempor incididunt ut labore et \ndolore magna aliqua. Ut enim ad minim veniam, quis \nnostrud exercitation ullamco laboris nisi ut aliquip \nex ea commodo consequat. Duis aute irure dolor in \nreprehenderit in voluptate velit esse cillum dolore \neu fugiat nulla pariatur.\n\"\"\"\n\nExpandableText(loremIpsum)\n```\n\u003c/td\u003e\n\u003ctd\u003e\n\n![Basic usage demo](https://user-images.githubusercontent.com/11541888/221367314-5e59b284-41a9-43d2-9ac2-4d51ee3bc46b.png)\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### Customization options\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n```swift\nExpandableText(loremIpsum)\n  .font(.headline)\n  .foregroundColor(.secondary)\n  .lineLimit(4)\n  .moreButtonText(\"read more\")\n  .moreButtonFont(.headline.bold())\n  .moreButtonColor(.red)\n  .enableCollapse(true)\n  .expandAnimation(.easeInOut(duration: 2))\n  .trimMultipleNewlinesWhenTruncated(false)\n```\n\u003c/td\u003e\n\u003ctd\u003e\n\n![Customization demo](https://user-images.githubusercontent.com/11541888/221367312-3062bd32-5eae-45d4-bf3a-0474985cb712.png)\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## Credits\n- [NuPlay/ExpandableText](https://github.com/NuPlay/ExpandableText) for inspiration and some portions of code\n\n## License\nAvailable under The Unlicense license. See [LICENSE](LICENSE) file for further information.\n\n\n\n\u003c/tr\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn3d1117%2Fexpandabletext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn3d1117%2Fexpandabletext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn3d1117%2Fexpandabletext/lists"}