{"id":32149169,"url":"https://github.com/johnnewman/circularspinner","last_synced_at":"2026-02-21T06:31:36.520Z","repository":{"id":230043614,"uuid":"777541114","full_name":"johnnewman/CircularSpinner","owner":"johnnewman","description":"A Swift package for drawing an animated circular spinner in SwiftUI.","archived":false,"fork":false,"pushed_at":"2024-09-11T00:47:52.000Z","size":1807,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T09:43:58.672Z","etag":null,"topics":["loading-indicator","loading-spinner","spinner","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/johnnewman.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}},"created_at":"2024-03-26T03:22:24.000Z","updated_at":"2025-09-23T18:51:55.000Z","dependencies_parsed_at":"2024-04-14T22:41:10.630Z","dependency_job_id":null,"html_url":"https://github.com/johnnewman/CircularSpinner","commit_stats":null,"previous_names":["johnnewman/circularspinner"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/johnnewman/CircularSpinner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnewman%2FCircularSpinner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnewman%2FCircularSpinner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnewman%2FCircularSpinner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnewman%2FCircularSpinner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnnewman","download_url":"https://codeload.github.com/johnnewman/CircularSpinner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnewman%2FCircularSpinner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280240302,"owners_count":26296527,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["loading-indicator","loading-spinner","spinner","swiftui"],"created_at":"2025-10-21T09:44:00.854Z","updated_at":"2025-10-21T09:44:03.533Z","avatar_url":"https://github.com/johnnewman.png","language":"Swift","readme":"## CircularSpinner\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fjohnnewman%2FCircularSpinner%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/johnnewman/CircularSpinner) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fjohnnewman%2FCircularSpinner%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/johnnewman/CircularSpinner)\n\nA Swift package for drawing an animated circular spinner in SwiftUI. Enjoy!\n\nCircularSpinner is a stroked background circle with a spinning foreground puck. The puck's length oscillates between long and short at each spin cycle. You can simply declare a CircularSpinner in your View hierarchy and it will automatically animate.\n\nThe stroked foreground and background can be any ShapeStyle. This allows for special effects like shadows and gradients to be applied to either layer. By default, the spinner will fill its container's bounds, but you can supply a diameter to the initializer.\n\n\u003cimg src=\"Git%20Resources/spinners.gif\" alt=\"Example GIF\" width=\"374\" height=\"109\" loop=infinite\u003e\n\n### API\n \nThere are two initializers. The main initializer offers the most customization, accepting separate background and forground ShapeStyles:\n\n```Swift\n/// Initializes an indefinitely animating CircularSpinner.\n/// - Parameters:\n///   - strokeWidth: The stroke width to use for the spinner background and foreground circles.\n///   - animationDuration: The duration of one spin cycle, which rotates the puck 2 full revolutions around the circle.\n///   - diameter: The diameter of the spinner. When nil, the spinner fills the container's bounds.\n///   - backgroundStyle: The ShapeStyle to apply to the full background circle.\n///   - foregroundStyle: The ShapeStyle to apply to the spinning puck.\npublic init(strokeWidth: CGFloat = 10,\n            animationDuration: TimeInterval = 1.75,\n            diameter: CGFloat? = nil,\n            backgroundStyle: Background = Color.secondary,\n            foregroundStyle: Foreground = Color.primary)\n```\n\n_Example use case:_\n```Swift\nCircularSpinner(\n    strokeWidth: 15,\n    animationDuration: 1,\n    backgroundStyle: .white.shadow(.inner(radius: 3)),\n    foregroundStyle: .red.shadow(.inner(radius: 3))\n)\n```\n\n### Premade styles \n\nThere is a second initializer that accepts a premade SpinnerStyle:\n```Swift\npublic init(strokeWidth: CGFloat = 10,\n            animationDuration: TimeInterval = 1.75,\n            diameter: CGFloat? = nil,\n            style: SpinnerStyle)\n```\n\n_Example use case:_\n```Swift\nCircularSpinner(style: .bubbledForeground)\n```\n\nHere is an example of each SpinnerStyle:\n\n| `bubbledForeground` | `hierarchy` | `accent` | `nineties` |\n| --- | --- | --- | --- |\n| \u003cimg src=\"Git%20Resources/bubbledForeground.jpg\" alt=\"bubbledForeground\" width=\"90\" height=\"90\"\u003e | \u003cimg src=\"Git%20Resources/hierarchy.jpg\" alt=\"hierarchy\" width=\"90\" height=\"90\"\u003e | \u003cimg src=\"Git%20Resources/accent.jpg\" alt=\"accent\" width=\"90\" height=\"90\"\u003e | \u003cimg src=\"Git%20Resources/nineties.jpg\" alt=\"nineties\" width=\"90\" height=\"90\"\u003e |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnewman%2Fcircularspinner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnnewman%2Fcircularspinner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnewman%2Fcircularspinner/lists"}