{"id":4801,"url":"https://github.com/prscX/react-native-spruce","last_synced_at":"2025-08-04T02:31:49.631Z","repository":{"id":57340336,"uuid":"114105122","full_name":"prscX/react-native-spruce","owner":"prscX","description":"React Native Bridge for Native Spruce Animation Library","archived":true,"fork":false,"pushed_at":"2020-07-18T11:10:50.000Z","size":196,"stargazers_count":530,"open_issues_count":6,"forks_count":33,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-07-31T09:47:18.186Z","etag":null,"topics":["android","ios","react-native"],"latest_commit_sha":null,"homepage":"https://github.com/willowtreeapps/spruce-android","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prscX.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}},"created_at":"2017-12-13T10:08:32.000Z","updated_at":"2025-07-17T16:50:17.000Z","dependencies_parsed_at":"2022-08-29T16:20:26.914Z","dependency_job_id":null,"html_url":"https://github.com/prscX/react-native-spruce","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/prscX/react-native-spruce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prscX%2Freact-native-spruce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prscX%2Freact-native-spruce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prscX%2Freact-native-spruce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prscX%2Freact-native-spruce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prscX","download_url":"https://codeload.github.com/prscX/react-native-spruce/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prscX%2Freact-native-spruce/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268639931,"owners_count":24282678,"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-08-04T02:00:09.867Z","response_time":79,"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":["android","ios","react-native"],"created_at":"2024-01-05T20:17:24.603Z","updated_at":"2025-08-04T02:31:49.353Z","avatar_url":"https://github.com/prscX.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/prscX"],"categories":["Components","动画","\u003ca name=\"Loaders-\u0026-Animation:-Native-Modules\"\u003eLoaders \u0026 Animation: Native Modules\u003c/a\u003e"],"sub_categories":["Animation","Web相关"],"readme":"\u003ch1 align=\"center\"\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/willowtreeapps/spruce-ios/raw/master/imgs/header_image.png\" height=\"300\" width=\"600\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/react-native-spruce\"\u003e\u003cimg src=\"http://img.shields.io/npm/v/react-native-spruce.svg?style=flat\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/prscX/react-native-spruce/pulls\"\u003e\u003cimg alt=\"PRs Welcome\" src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/prscX/react-native-spruce#License\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/react-native-spruce.svg?style=flat\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n    ReactNative Spruce - (Android \u0026 iOS): Deprecated\n\nDue to time constraint, this library is deprecated and not maintained anymore, You can still use this library.\n\nIf this project has helped you out, please support us with a star 🌟\n\u003c/h1\u003e\n\nSpruce is a lightweight animation library that helps choreograph the animations on the screen. With so many different animation libraries out there, developers need to make sure that each view is animating at the appropriate time. Spruce can help designers request complex multi-view animations and not have the developers cringe at the prototype.\n\nIt provides a React Native Bridge around native spruce library. Here is a quick example of how you can Spruce up your screens!\n\n\u003e **Note**: Currently on iOS it is not supported due to unavailable of Spruce Objective-C wrappers, please refer issue: [101](https://github.com/willowtreeapps/spruce-ios/issues/101)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/willowtreeapps/spruce-ios/raw/master/imgs/extensibility-tests.gif\" /\u003e\n\u003c/p\u003e\n\n## 📖 Getting started\n\n`$ npm install react-native-spruce --save`\n\n`$ react-native link react-native-spruce`\n\n- **Android**\n\n  - Please copy below snippet in your app `build.gradle` file:\n\n```\nbuildscript {\n    repositories {\n        jcenter()\n        google()\n        ...\n    }\n}\n\nallprojects {\n    repositories {\n        mavenLocal()\n        jcenter()\n        google()\n        ...\n    }\n}\n```\n\n\u003e **Note**: Android SDK 27 \u003e is supported\n\n## 💻 Usage\n\n```javascript\nimport {\n  Spruce,\n  CorneredSort,\n  DefaultAnimations\n} from \"react-native-spruce\";\n\n\n// TODO: What to do with the module?\n\nrender () {\n  let sortWith = new CorneredSort(100);\n  let animateWith = DefaultAnimations.shrinkAnimator(1000)\n\n  \u003cSpruce sortWith={sortWith} animateWith={animateWith} animator={{ propertyName: \"translationX\", values: [5000, 0], duration: 800 }}\u003e\n    \u003cView /\u003e\n  \u003c/Spruce\u003e\n}\n\n```\n\n## Using a SortFunction\nLuckily, RNSpruce comes with 8 `SortFunction` implementations with a wide open possibility to make more! Use the `SortFunction` to change the order in which views animate. Consider the following example:\n\n```javascript\nlet sort = new LinearSort(/*interObjectDelay=*/100L, /*reversed=*/false, LinearSort.Direction.TOP_TO_BOTTOM);\n```\n\nTo make sure that developers can use RNSpruce out of the box, we included about 8 stock `SortFunction` implementations. These are some of the main functions we use at WillowTree and are so excited to see what others come up with!\n\n- `DefaultSort`\n```javascript\nlet sort = new DefaultSort(/*interObjectDelay=*/100L);\n```\n\n- `LinearSort`\n```javascript\nlet sort = new LinearSort(/*interObjectDelay=*/100L, /*reversed=*/false, LinearSort.Direction.TOP_TO_BOTTOM);\n```\n\n- `CorneredSort`\n```javascript\nlet sort = new CorneredSort(/*interObjectDelay=*/100L, /*reversed=*/false, CorneredSort.Corner.TOP_LEFT);\n```\n\n- `RadialSort`\n```javascript\nlet sort = new RadialSort(/*interObjectDelay=*/100L, /*reversed=*/false, RadialSort.Position.TOP_LEFT);\n```\n\n- `RandomSort`\n```javascript\nlet sort = new RandomSort(/*interObjectDelay=*/100L);\n```\n\n- `InlineSort`\n```javascript\nlet sort = new InlineSort(/*interObjectDelay=*/100L, /*reversed=*/false, LinearSort.Direction.TOP_TO_BOTTOM);\n```\n\n- `ContinousSort`\n```javascript\nlet sort = new ContinousSort(/*interObjectDelay=*/100L, /*reversed=*/false, ContinousSort.Position.TOP_LEFT);\n```\n\n## Stock Animators\n\nTo make everybody's lives easier, the stock animators perform basic View animations that a lot of apps use today. Mix and match these animators to get the core motion you are looking for.\n\n- `DefaultAnimations.growAnimator(duration:number)`\n- `DefaultAnimations.shrinkAnimator(duration:number)`\n- `DefaultAnimations.fadeAwayAnimator(duration:number)`\n- `DefaultAnimations.fadeInAnimator(duration:number)`\n- `DefaultAnimations.spinAnimator(duration:number)`\n\n\nExperiment which ones work for you! If you think of anymore feel free to add them to the library yourself!\n\n\n## ✨ Credits\n\n- [willowtreeapps/spruce-android](https://github.com/willowtreeapps/spruce-android)\n- [willowtreeapps/spruce-ios](https://github.com/willowtreeapps/spruce-ios)\n\n## 🤔 How to contribute\nHave an idea? Found a bug? Please raise to [ISSUES](https://github.com/prscX/react-native-spruce/issues).\nContributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.\n\n## 💫 Where is this library used?\nIf you are using this library in one of your projects, add it in this list below. ✨\n\n\n## 📜 License\nThis library is provided under the Apache 2 License.\n\nRNSpruce @ [prscX](https://github.com/prscX)\n\n## 💖 Support my projects\nI open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).\n\nHowever, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:\n* Starring and sharing the projects you like 🚀\n* If you're feeling especially charitable, please follow [prscX](https://github.com/prscX) on GitHub.\n\n  \u003ca href=\"https://www.buymeacoffee.com/prscX\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\n\n  Thanks! ❤️\n  \u003cbr/\u003e\n  [prscX.github.io](https://prscx.github.io)\n  \u003cbr/\u003e\n  \u003c/ Pranav \u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FprscX%2Freact-native-spruce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FprscX%2Freact-native-spruce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FprscX%2Freact-native-spruce/lists"}