{"id":28386239,"url":"https://github.com/nuplay/animationkit","last_synced_at":"2026-04-06T06:32:12.657Z","repository":{"id":284350067,"uuid":"802806298","full_name":"NuPlay/AnimationKit","owner":"NuPlay","description":"AnimationKit simplifies sequential animations in iOS and macOS apps with SwiftUI.","archived":false,"fork":false,"pushed_at":"2025-03-25T12:20:32.000Z","size":13,"stargazers_count":28,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T13:47:39.129Z","etag":null,"topics":["animatable","animation-library","animations","ios","macos","swift","swift-package-manager","swiftui","ui-components"],"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/NuPlay.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,"zenodo":null}},"created_at":"2024-05-19T10:21:28.000Z","updated_at":"2025-03-30T12:01:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"47853904-7b7a-4dc0-853e-7b2b21610707","html_url":"https://github.com/NuPlay/AnimationKit","commit_stats":null,"previous_names":["nuplay/animationkit"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/NuPlay/AnimationKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NuPlay%2FAnimationKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NuPlay%2FAnimationKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NuPlay%2FAnimationKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NuPlay%2FAnimationKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NuPlay","download_url":"https://codeload.github.com/NuPlay/AnimationKit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NuPlay%2FAnimationKit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31463013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"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":["animatable","animation-library","animations","ios","macos","swift","swift-package-manager","swiftui","ui-components"],"created_at":"2025-05-30T13:40:54.440Z","updated_at":"2026-04-06T06:32:12.643Z","avatar_url":"https://github.com/NuPlay.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AnimationKit\n\u003cimg src=\"https://github.com/NuPlay/AnimationKit/assets/73557895/0d3459be-8158-451b-a9b3-d4f32223de49\" align=\"right\" width=\"300\"/\u003e\n\n\u003cp\u003e\n    \u003ca href=\"https://www.apple.com/ios/\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/iOS-14.0+-007AFF?labelColor=303840\" alt=\"iOS: 14.0+\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.apple.com/macos/\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/macOS-11.0+-007AFF?labelColor=303840\" alt=\"macOS-11.0+\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n### Swift Package Manager\n```swift\ndependencies: [\n    .package(url: \"https://github.com/NuPlay/AnimationKit.git\", .upToNextMinor(from: \"1.0.0\"))\n]\n```\n\n# Usage\n### When creating a simple view\n```swift\nimport SwiftUI\nimport AnimationKit\n\nstruct AnimationKit_Test: View {\n  var body: some View {\n    VStack {\n      AnimatedStack(preset: .default) {\n        Text(\"Hello, World!\")\n          .font(.title)\n        Text(\"This is Simple Stack View\")\n          .font(.title2)\n        Rectangle()\n          .fill(Color.blue)\n          .frame(width: 100, height: 100)\n      }\n    }\n  }\n}\n```\n\n### When using ForEach\n```swift\nimport SwiftUI\nimport AnimationKit\n\nstruct AnimationKit_Test: View {\n  @State private var emojiData: [String] = [\"🚀\", \"🛸\", \"🛰\", \"🌌\", \"🌠\", \"🌟\", \"🌕\", \"🌍\", \"🪐\", \"🌑\", \"🌒\", \"🌓\", \"🌔\", \"🌖\", \"🌗\", \"🌘\", \"🌙\", \"🌚\", \"🌝\", \"🌞\"]\n  \n  var body: some View {\n    ScrollView {\n      LazyVStack {\n        AnimatedForEach(emojiData, preset: .list) { emoji in\n          Text(emoji)\n            .font(.system(size: 100))\n        }\n      }\n    }\n  }\n}\n```\n```swift\nimport SwiftUI\nimport AnimationKit\n\nstruct AnimationKitGrid_Test: View {\n  @State private var emojiData: [String] = [\"🚀\", \"🛸\", \"🛰\", \"🌌\", \"🌠\", \"🌟\", \"🌕\", \"🌍\", \"🪐\", \"🌑\", \"🌒\", \"🌓\", \"🌔\", \"🌖\", \"🌗\", \"🌘\", \"🌙\", \"🌚\", \"🌝\", \"🌞\"]\n  let columns = [GridItem(.adaptive(minimum: 100))]\n  \n  var body: some View {\n    ScrollView {\n      LazyVGrid(columns: columns, spacing: 20) {\n        AnimatedForEach(emojiData, preset: .grid) { emoji in\n          Text(emoji)\n            .font(.system(size: 100))\n        }\n      }\n      .padding()\n    }\n  }\n}\n```\n\n# CustomAnimation\n### You need to adopt the AnimatableStyle protocol.\n```swift\npublic protocol AnimatableStyle {\n  var opacity: AnimationValue\u003cCGFloat\u003e { get }\n  var offsetX: AnimationValue\u003cCGFloat\u003e { get }\n  var offsetY: AnimationValue\u003cCGFloat\u003e { get }\n  var rotation: AnimationValue\u003cDouble\u003e { get }\n  var scale: AnimationValue\u003cDouble\u003e { get }\n  var blur: AnimationValue\u003cDouble\u003e { get }\n  var delay: Double { get }\n  var animation: Animation { get }\n  var maxAnimationCount: Int { get }\n}\n```\n### You can create a struct that adopts the protocol as shown below.\n```swift\nstruct YourCustomAnimationConfig: AnimatableStyle {\n  var opacity: AnimationValue\u003cCGFloat\u003e = .init(from: 0, to: 1)\n  var offsetX: AnimationValue\u003cCGFloat\u003e = .init(from: 0, to: 0)\n  var offsetY: AnimationValue\u003cCGFloat\u003e = .init(from: 50, to: 0)\n  var rotation: AnimationValue\u003cDouble\u003e = .init(from: 0, to: 0)\n  var scale: AnimationValue\u003cDouble\u003e = .init(from: 1, to: 1)\n  var blur: AnimationValue\u003cDouble\u003e = .init(from: 8, to: 0)\n  var delay: Double = 0.05\n  var animation: Animation = .bouncy(duration: 0.4)\n  var maxAnimationCount: Int = 20\n}\n```\n```swift\nAnimatedForEach(emojiData, preset: YourCustomAnimationConfig()) { emoji in\n\n}\n```\n\n### You can modify the values of AnimationConfig as needed.\n```swift\npublic struct AnimationConfig: Hashable, Equatable, AnimatableStyle {\n  public var opacity: AnimationValue\u003cCGFloat\u003e\n  public var offsetX: AnimationValue\u003cCGFloat\u003e\n  public var offsetY: AnimationValue\u003cCGFloat\u003e\n  public var rotation: AnimationValue\u003cDouble\u003e\n  public var scale: AnimationValue\u003cDouble\u003e\n  public var blur: AnimationValue\u003cDouble\u003e\n  public var delay: Double\n  public var animation: Animation\n  public var maxAnimationCount: Int\n\n  public init(\n    opacity: AnimationValue\u003cCGFloat\u003e,\n    offsetX: AnimationValue\u003cCGFloat\u003e,\n    offsetY: AnimationValue\u003cCGFloat\u003e,\n    rotation: AnimationValue\u003cDouble\u003e,\n    scale: AnimationValue\u003cDouble\u003e,\n    blur: AnimationValue\u003cDouble\u003e,\n    delay: Double = 0.05,\n    animation: Animation = .bouncy(duration: 0.4),\n    maxAnimationCount: Int = 20\n  ) {\n    self.opacity = opacity\n    self.offsetX = offsetX\n    self.offsetY = offsetY\n    self.rotation = rotation\n    self.scale = scale\n    self.blur = blur\n    self.delay = delay\n    self.animation = animation\n    self.maxAnimationCount = maxAnimationCount\n  }\n}\n```\n```swift\nlet preset: AnimationConfig = AnimationConfig(\n  opacity: .init(from: 0, to: 1),\n  offsetX: .init(from: 50, to: 0),\n  offsetY: .init(from: 10, to: 0),\n  rotation: .init(from: 0, to: 0),\n  scale: .init(from: 1.3, to: 1),\n  blur: .init(from: 8, to: 0)\n)\n\nAnimatedForEach(emojiData, preset: preset) { emoji in\n\n}\n```\n\n### Explanation of `AnimatableStyle` Variables\n| Variable            | Type                       | Description                                                                                             |\n|---------------------|----------------------------|---------------------------------------------------------------------------------------------------------|\n| `opacity`           | `AnimationValue\u003cCGFloat\u003e`  | Defines the animation values for opacity.                                                               |\n| `offsetX`           | `AnimationValue\u003cCGFloat\u003e`  | Defines the animation values for horizontal offset.                                                     |\n| `offsetY`           | `AnimationValue\u003cCGFloat\u003e`  | Defines the animation values for vertical offset.                                                       |\n| `rotation`          | `AnimationValue\u003cDouble\u003e`   | Defines the animation values for rotation.                                                              |\n| `scale`             | `AnimationValue\u003cDouble\u003e`   | Defines the animation values for scaling.                                                               |\n| `blur`              | `AnimationValue\u003cDouble\u003e`   | Defines the animation values for blur effect.                                                           |\n| `delay`             | `Double`                   | Determines the delay before each animation starts.                                                      |\n| `animation`         | `Animation`                | Set to your desired animation type.                                                                     |\n| `maxAnimationCount` | `Int`                      | Maximum number of animations to play.                                                                   |\n|                     |                            | If set to 20, animations play up to the 20th item (index 19) according to the delay.                    |\n|                     |                            | The 21st and subsequent items will animate simultaneously with the 21st.                                |\n|                     |                            | This prevents excessive delays when animating large sets of data.                                       |\n|                     |                            | For example, without this option, you would need to wait `delay * 99` seconds to see the 100th item.    |\n\n\u003cimg src=\"https://github.com/NuPlay/AnimationKit/assets/73557895/e1b686be-fc96-4a84-a119-10cc432ceb1c\" align=\"right\" width=\"300\"/\u003e\n\n### AnimationStyle Preset\n```swift\nvar delay: Double = 0.05,\nvar animation: Animation = .bouncy(duration: 0.4),\nvar maxAnimationCount: Int = 20\n\nextension AnimationStyle {\n  var config: AnimationConfig {\n    switch self {\n    case .`default`:\n      return AnimationConfig(\n        opacity: .init(from: 0, to: 1),\n        offsetX: .init(from: 0, to: 0),\n        offsetY: .init(from: 50, to: 0),\n        rotation: .init(from: 0, to: 0),\n        scale: .init(from: 1.0, to: 1.0),\n        blur: .init(from: 0, to: 0)\n      )\n    case .grid:\n      return AnimationConfig(\n        opacity: .init(from: 0, to: 1),\n        offsetX: .init(from: 0, to: 0),\n        offsetY: .init(from: 100, to: 0),\n        rotation: .init(from: 0, to: 0),\n        scale: .init(from: 1.3, to: 1.0),\n        blur: .init(from: 8, to: 0)\n      )\n    case .list:\n      return AnimationConfig(\n        opacity: .init(from: 0, to: 1),\n        offsetX: .init(from: 50, to: 0),\n        offsetY: .init(from: 0, to: 0),\n        rotation: .init(from: 0, to: 0),\n        scale: .init(from: 1.1, to: 1.0),\n        blur: .init(from: 0, to: 0)\n      )\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuplay%2Fanimationkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuplay%2Fanimationkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuplay%2Fanimationkit/lists"}