{"id":13537035,"url":"https://github.com/markiv/SwiftUI-Shimmer","last_synced_at":"2025-04-02T03:31:32.547Z","repository":{"id":39342654,"uuid":"350812836","full_name":"markiv/SwiftUI-Shimmer","owner":"markiv","description":"Shimmer is a super-light modifier that adds a shimmering effect to any SwiftUI View, for example, to show that an operation is in progress. It works well on light and dark modes, and across iOS, macOS, tvOS, watchOS and visionOS.","archived":false,"fork":false,"pushed_at":"2024-01-28T11:42:38.000Z","size":252,"stargazers_count":903,"open_issues_count":7,"forks_count":55,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-04-24T02:02:43.231Z","etag":null,"topics":["ios","macos","shimmer","skeleton","swift","swiftui","tvos","visionos","watch"],"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/markiv.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":"2021-03-23T18:14:34.000Z","updated_at":"2024-06-06T17:35:08.245Z","dependencies_parsed_at":"2024-01-14T02:37:18.411Z","dependency_job_id":"afd5033f-c365-45d9-98ab-88ae58771dbf","html_url":"https://github.com/markiv/SwiftUI-Shimmer","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":"0.36363636363636365","last_synced_commit":"17b66b0e7d94d2d3f220bbcb021b5026436f06c7"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markiv%2FSwiftUI-Shimmer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markiv%2FSwiftUI-Shimmer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markiv%2FSwiftUI-Shimmer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markiv%2FSwiftUI-Shimmer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markiv","download_url":"https://codeload.github.com/markiv/SwiftUI-Shimmer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246746938,"owners_count":20827061,"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","macos","shimmer","skeleton","swift","swiftui","tvos","visionos","watch"],"created_at":"2024-08-01T09:00:53.871Z","updated_at":"2025-04-02T03:31:32.530Z","avatar_url":"https://github.com/markiv.png","language":"Swift","readme":"# SwiftUI-Shimmer ✨\n\n`Shimmer` is a super-light modifier that adds a \"shimmering\" effect to any SwiftUI `View`, for example, to show that an operation is in progress. It works well on light and dark modes, left-to-right and right-to-left layout directions, and across all Apple platforms: iOS, macOS, tvOS, watchOS and even visionOS! 📱💻🖥️📺⌚️🥽✨\n\n![visionOS](docs/Shimmer-visionOS.gif) ![watchOS](docs/Shimmer-watchOS.gif)\n\n\n## Usage\n\n```swift\nimport SwiftUI\nimport Shimmer\n⋮\n⋮\nText(\"SwiftUI Shimmer\").modifier(Shimmer())\n```\nor more conveniently\n\n```swift\nText(\"SwiftUI Shimmer\").shimmering()\n```\n\n![Light Mode](docs/light.gif)\n![Dark Mode](docs/dark.gif)\n\n## Optional Parameters ⚙️\n\n- `active`: Convenience parameter to conditionally enable the effect. Defaults to `true`.\n- `animation`: A custom animation. Defaults to `Shimmer.defaultAnimation`.\n- `gradient`: A custom gradient. Defaults to `Shimmer.defaultGradient`.\n- `bandSize`: The size of the animated mask's \"band\". Defaults to 0.2 unit points, which corresponds to 20% of the extent of the gradient.\n\n### Backward Compatible Parameters\n\n- `active`: Convenience parameter to conditionally enable the effect. Defaults to `true`.\n- `duration`: The duration of a shimmer cycle in seconds. Default: `1.5`.\n- `bounce`: Whether to bounce (reverse) the animation back and forth. Defaults to `false`.\n- `delay`: A delay in seconds. Defaults to `0`.\n\n![Bounce 3](docs/bounce3.gif)\n\n## Custom Animations\n\nYou can supply any custom animation:\n\n```swift\nText(\"Loading...\")\n    .shimmering(\n        active: isAnimating,\n        animation: .easeInOut(duration: 2).repeatCount(5, autoreverses: false).delay(1)\n    )\n```\n\n## Gradient Mode\n\nIn addition to the original masking mode (which is still the default), Shimmer now supports additional modes to apply the gradient, including as a background or an overlay with a custom blend mode:\n\n![Loading](docs/custom-gradient-mode.gif)\n\n```swift\nText(\"Custom Gradient Mode\").bold()\n    .font(.largeTitle)\n    .shimmering(\n        gradient: Gradient(colors: [.clear, .orange, .white, .green, .clear]),\n        bandSize: 0.5,\n        mode: .overlay()\n    )\n```\n\n## Animated Skeletons ☠️\n\nOf course, you can combine `.shimmering(...)` with the `.redacted(...)` modifier to create interesting animated skeleton views.\n\n![Loading](docs/loading.gif)\n\n```swift\nText(\"Some text\")\n    .redacted(reason: .placeholder)\n    .shimmering()\n```\n\n## Right-To-Left (RTL) Support\n\nThe mask and animation now adjusts automatically to the environment's `layoutDirection` in order to better support \ndifferent languages and locales.  \n\n## Installation\n\n### Swift Package Manager\nUse the package URL or search for the SwiftUI-Shimmer package: [https://github.com/markiv/SwiftUI-Shimmer](https://github.com/markiv/SwiftUI-Shimmer).\n\nFor how-to integrate package dependencies refer to [Adding Package Dependencies to Your App documentation](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app).\n\n### Cocoapods\nAdd this to your Podfile:\n\n```ruby\npod 'SwiftUI-Shimmer', :git =\u003e 'https://github.com/markiv/SwiftUI-Shimmer.git'\n```\n\n## What About UIKit?\n\nFor an older, UIKit-based shimmer effect, see [UIView-Shimmer](https://github.com/markiv/UIView-Shimmer).\n","funding_links":[],"categories":["Samples","Swift","Libraries"],"sub_categories":["SwiftUI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkiv%2FSwiftUI-Shimmer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkiv%2FSwiftUI-Shimmer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkiv%2FSwiftUI-Shimmer/lists"}