{"id":13777442,"url":"https://github.com/changemin/LoadingButton","last_synced_at":"2025-05-11T11:33:36.299Z","repository":{"id":45613020,"uuid":"317583092","full_name":"changemin/LoadingButton","owner":"changemin","description":"Loading Animation Button for SwiftUI","archived":false,"fork":false,"pushed_at":"2023-11-22T22:35:56.000Z","size":2767,"stargazers_count":116,"open_issues_count":1,"forks_count":11,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-08-03T18:11:37.068Z","etag":null,"topics":["animation","button","loading","loadingbutton","spm","swift","swift5","swiftui"],"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/changemin.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}},"created_at":"2020-12-01T15:23:24.000Z","updated_at":"2024-06-16T18:18:30.000Z","dependencies_parsed_at":"2024-01-16T12:49:38.536Z","dependency_job_id":"144c5d9d-6b78-419a-b99f-4b00aee71d2f","html_url":"https://github.com/changemin/LoadingButton","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changemin%2FLoadingButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changemin%2FLoadingButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changemin%2FLoadingButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/changemin%2FLoadingButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/changemin","download_url":"https://codeload.github.com/changemin/LoadingButton/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225043129,"owners_count":17411932,"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":["animation","button","loading","loadingbutton","spm","swift","swift5","swiftui"],"created_at":"2024-08-03T18:00:43.399Z","updated_at":"2024-11-17T13:30:44.087Z","avatar_url":"https://github.com/changemin.png","language":"Swift","funding_links":[],"categories":["Button"],"sub_categories":["Content"],"readme":"\u003cp align=\"center\"\u003e\n \u003cimg width=300px  src=\"imgs/Logo.gif\" alt=\"Project logo\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003e🔄 SwiftUI LoadingButton 🔄\u003c/h3\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![License](https://img.shields.io/github/license/Changemin/LoadingButton?style=for-the-badge)\n![Release](https://img.shields.io/github/v/release/Changemin/LoadingButton?style=for-the-badge)\n\n\n\u003c/div\u003e\n\n---\n\n\u003cp align=\"center\"\u003e \n    Simple Loading Animation Button for SwiftUI\n    \u003cbr\u003e \n\u003c/p\u003e\n\n## 📹 Preview\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"imgs/Preview-zoom.gif\" width=\"40%\" /\u003e\n\u003c/p\u003e\n\n## 🏁 Getting Started\n\n### Requirements\n* Xcode 11+\n* SwiftUI\n* iOS 14+\n* macOS 10.15+\n\n### Installaion\n#### Swift Package Manager(SPM)\n    File ➜ Swift Packages ➜ Add Package Dependancy..\n\n```Swift\n.package(url: \"https://github.com/Changemin/LoadingButton\", from: \"1.1.2\")\n```\n\n## 🎈Usage\n```Swift\nLoadingButton(action: { }, isLoading: \u003cBinding\u003eBool, style: LoadingButtonStyle) {\n    // View on the button\n    // style is optional parameter\n```\n* `action` : Actions to do when button clicked\n* `isLoading` : `\u003cBinding\u003eBool` type. you can control loading status with this.\n* `style`(Optional) : Custom style with `LoadingButtonStyle`\n\n#### 🛠Custom Modifiers\n```Swift\nLoadingButtonStyle(width: CGFloat, \n                   height: CGFloat,\n                   cornerRadius: CGFloat,\n                   backgroundColor: Color,\n                   loadingColor: Color,\n                   strokeWidth: CGFloat,\n                   strokeColor: Color)\n\n// All of the parameter is optional\n```\n* `width`(Optional) : Width of button\n* `height`(Optional) : Height of button\n* `cornerRadius`(Optional) : Corner radius of button\n* `backgroundColor`(Optional) : Background color of button\n* `loadingColor`(Optional) : Background color of button when `Loading`, default is 50% opacity of `backgroundColor`\n* `strokeWidth`(Optional) : Circle loading indicator stroke width\n* `strokeColor`(Optional) : Circle loading indicator stroke Color(default: gray)\n\n## Example\n#### 👶 Simple\n```Swift\nimport SwiftUI\nimport LoadingButton\n\nstruct ContentView: View {\n    @State var isLoading: Bool = false\n    \n    var body: some View {\n        LoadingButton(action: {\n            // Your Action here\n        }, isLoading: $isLoading) {\n            Text(\"LoadingButton\").foregroundColor(Color.white)\n        }\n    }\n}\n```\n### Result\n\u003cimg src=\"imgs/Example-1.png\" height=\"100\"\u003e\n\u003cimg src=\"imgs/Example-1-1.png\" height=\"100\"\u003e\n\n### 💅🏻 Applying Fully Custom Style\n```Swift\nimport SwiftUI\nimport LoadingButton\n\nstruct ContentView: View {\n    @State var isLoading: Bool = false\n    var style = LoadingButtonStyle(width: 312,\n                              height: 54,\n                              cornerRadius: 27,\n                              backgroundColor: .orange,\n                              loadingColor: Color.orange.opacity(0.5),\n                              strokeWidth: 5,\n                              strokeColor: .gray)\n    \n    var body: some View {\n        LoadingButton(action: {\n            // Your Action here\n        }, isLoading: $isLoading, style: style) {\n            Text(\"Styled LoadingButton\").foregroundColor(Color.white)\n        }\n    }\n}\n```\n### Result\n\u003cimg src=\"imgs/Example-2.png\" height=\"100\"\u003e\n\u003cimg src=\"imgs/Example-2-1.png\" height=\"100\"\u003e\n\n### 💅🏻 Styling Only Needs\n```Swift\nimport SwiftUI\nimport LoadingButton\n\nstruct ContentView: View {\n    @State var isLoading: Bool = false\n    \n    var body: some View {\n        LoadingButton(action: {\n            // Your Action here\n        }, isLoading: $isLoading, style: LoadingButtonStyle(cornerRadius: 27, backgroundColor: .orange)) {\n            Text(\"Styled LoadingButton\").foregroundColor(Color.white)\n        }\n    }\n}\n```\n### Same Result\n\u003cimg src=\"imgs/Example-2.png\" height=\"100\"\u003e\n\u003cimg src=\"imgs/Example-2-1.png\" height=\"100\"\u003e\n\n\n## ✅ TODO\n- [ ] End animation(normal, shake(when fail), expand)\n- [ ] Support gradient background color\n\n## 📜 License\n\nLoadingButton is available under the MIT license. See the `LICENSE` file for more info.\n\n## ✍️ Author\n\n- Byun Kyung Min ➜ [🇰🇷@Changemin](https://github.com/Changemin)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchangemin%2FLoadingButton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchangemin%2FLoadingButton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchangemin%2FLoadingButton/lists"}