{"id":24543848,"url":"https://github.com/douglasjunior/react-native-gradient-shimmer","last_synced_at":"2025-04-06T13:09:22.624Z","repository":{"id":150697955,"uuid":"623072062","full_name":"douglasjunior/react-native-gradient-shimmer","owner":"douglasjunior","description":"⚛ A pure JavaScript, performant, typed shimmer component for Android, iOS and Web","archived":false,"fork":false,"pushed_at":"2025-03-01T00:38:58.000Z","size":16300,"stargazers_count":48,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T12:07:44.145Z","etag":null,"topics":["android","animated","ios","linear-gradient","placeholder","react-native","shimmer","skeleton","web"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/douglasjunior.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"douglasjunior","patreon":"douglasjunior","custom":"paypal.me/douglasnassif"}},"created_at":"2023-04-03T16:29:52.000Z","updated_at":"2025-02-17T03:12:14.000Z","dependencies_parsed_at":"2024-12-28T01:20:29.007Z","dependency_job_id":"4e69bf7c-d348-4c3f-9c93-058fa86a6278","html_url":"https://github.com/douglasjunior/react-native-gradient-shimmer","commit_stats":{"total_commits":51,"total_committers":2,"mean_commits":25.5,"dds":0.0980392156862745,"last_synced_commit":"d4a28e8e4aae5d7e41bbd5f7a177e36771282380"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasjunior%2Freact-native-gradient-shimmer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasjunior%2Freact-native-gradient-shimmer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasjunior%2Freact-native-gradient-shimmer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasjunior%2Freact-native-gradient-shimmer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/douglasjunior","download_url":"https://codeload.github.com/douglasjunior/react-native-gradient-shimmer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485287,"owners_count":20946398,"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":["android","animated","ios","linear-gradient","placeholder","react-native","shimmer","skeleton","web"],"created_at":"2025-01-22T20:15:19.241Z","updated_at":"2025-04-06T13:09:22.597Z","avatar_url":"https://github.com/douglasjunior.png","language":"TypeScript","funding_links":["https://github.com/sponsors/douglasjunior","https://patreon.com/douglasjunior","paypal.me/douglasnassif","https://www.patreon.com/douglasjunior","https://paypal.me/douglasnassif"],"categories":[],"sub_categories":[],"readme":"# React-Native Gradient Shimmer\n\n[![License MIT](https://img.shields.io/badge/licence-MIT-blue.svg)](https://github.com/douglasjunior/react-native-gradient-shimmer/blob/master/LICENSE)\n[![npm version](https://img.shields.io/npm/v/react-native-gradient-shimmer.svg)](https://www.npmjs.com/package/react-native-gradient-shimmer?activeTab=versions)\n[![npm downloads](https://img.shields.io/npm/dt/react-native-gradient-shimmer.svg)](https://www.npmjs.com/package/react-native-gradient-shimmer)\n\n⚛ A pure JavaScript, performant, typed shimmer component for Android, iOS and Web.\n\nIt uses React Native [Animated](https://reactnative.dev/docs/animated) API for animation, and [expo-linear-gradient](https://docs.expo.dev/versions/latest/sdk/linear-gradient/) or [react-native-linear-gradient](https://github.com/react-native-linear-gradient/react-native-linear-gradient) for the gradient effect.\n\nTake a look at the [Online demo](https://snack.expo.dev/@douglasjunior/react-native-gradient-shimmer).\n\n|Android|iOS|Web|\n|-|-|-|\n|\u003cimg src=\"https://github.com/douglasjunior/react-native-gradient-shimmer/raw/main/screenshots/android.gif\" width=\"240\"/\u003e|\u003cimg src=\"https://github.com/douglasjunior/react-native-gradient-shimmer/raw/main/screenshots/ios.gif\" width=\"240\"/\u003e|\u003cimg src=\"https://github.com/douglasjunior/react-native-gradient-shimmer/raw/main/screenshots/web.gif\" width=\"240\"/\u003e\n\n## Requirements\n\n- React Native \u003e= 0.60.0\n- [expo-linear-gradient](https://docs.expo.dev/versions/latest/sdk/linear-gradient/) or [react-native-linear-gradient](https://github.com/react-native-linear-gradient/react-native-linear-gradient)\n\n## Install\n\nInstall dependency package\n```bash\nyarn add react-native-gradient-shimmer\n```\n\nOr\n\n```bash\nnpm i -S react-native-gradient-shimmer\n```\n\n## Basic usage\n\nRender the `GradientShimmer` directly:\n\n```jsx\nimport LinearGradient from 'react-native-linear-gradient'; // or 'expo-linear-gradient'\nimport GradientShimmer from 'react-native-gradient-shimmer';\n\nconst App = () =\u003e {\n   return (\n      \u003cSafeAreaView style={{flex: 1}}\u003e\n         \u003cGradientShimmer\n            LinearGradientComponent={LinearGradient}\n            backgroundColor=\"red\"\n            highlightColor=\"blue\"\n            height={120}\n            width={120}\n            style={{\n              borderRadius: 60,\n              margin: 8,\n            }}\n         /\u003e\n      \u003c/SafeAreaView\u003e\n   );\n}\n\nexport default App;\n```\n\nOr create your own `GradientShimmer` instance with default props:\n\n```jsx\nimport LinearGradient from 'react-native-linear-gradient'; // or 'expo-linear-gradient'\nimport {createGradientShimmer} from 'react-native-gradient-shimmer';\n\nconst CustomGradientShimmer = createGradientShimmer({\n  backgroundColor: 'red',\n  highlightColor: 'blue',\n  LinearGradientComponent: LinearGradient,\n})\n\nconst App = () =\u003e {\n   return (\n      \u003cSafeAreaView style={{flex: 1}}\u003e\n         \u003cCustomGradientShimmer\n            height={120}\n            width={120}\n            style={{\n              borderRadius: 60,\n              margin: 8,\n            }}\n         /\u003e\n      \u003c/SafeAreaView\u003e\n   );\n}\n\nexport default App;\n```\n\nSee more in the [Sample project](https://github.com/douglasjunior/react-native-gradient-shimmer/blob/main/Sample/App.tsx).\n\n## Shimmer layout\n\nFor more complex layouts, you can use the `ShimmerLayout` component.\n\n```jsx\nimport LinearGradient from 'react-native-linear-gradient'; // or 'expo-linear-gradient'\nimport {ShimmerLayout, ShimmerLayoutContainerType} from 'react-native-gradient-shimmer';\n\nconst layoutExample: ShimmerLayoutContainerType = {\n   content: [\n      {\n         flexDirection: 'row',\n         content: [\n            {\n               height: 150,\n               width: 100,\n               marginRight: 16,\n            },\n            {\n               justifyContent: 'space-between',\n               content: [\n               {\n                  height: 40,\n                  width: 250,\n               },\n               {\n                  height: 40,\n                  width: 250,\n               },\n               {\n                  height: 40,\n                  width: 120,\n               },\n               ],\n            },\n         ],\n      },\n      // ....\n   ],\n};\n\nconst App = () =\u003e {\n   return (\n      \u003cSafeAreaView style={{flex: 1}}\u003e\n         \u003cShimmerLayout\n            LinearGradientComponent={LinearGradient}\n            layout={layoutExample}\n         /\u003e\n      \u003c/SafeAreaView\u003e\n   );\n}\n\nexport default App;\n```\n\nSee more in the [Sample project](https://github.com/douglasjunior/react-native-gradient-shimmer/blob/main/Sample/App.tsx).\n\n## Props and types\n\n### GradientShimmer props\n\n|Name|Type|Default|Description|\n|-|-|-|-|\n|LinearGradientComponent|`ComponentType`||Linear gradient component from [expo-linear-gradient](https://docs.expo.dev/versions/latest/sdk/linear-gradient/) or [react-native-linear-gradient](https://github.com/react-native-linear-gradient/react-native-linear-gradient)|\n|width|`number`||Component `width` in DPI|\n|height|`number`||Component `height` in DPI|\n|backgroundColor|`string`|`'rgb(200,200,200)'`|Background color in HEX or RGB|\n|highlightColor|`string`|`'rgb(210,210,210)'`|Highlight color in HEX or RGB|\n|highlightWidth|`number`|`200`|The size of the highlight effect in DPI|\n|duration|`number`|`1500`|Duration of the animation in milliseconds|\n|animating|`boolean`|`true`|Start or stop the animation|\n|easing|`(value: number) =\u003e number`|`Easing.linear`|Easing function used by `Animated.timing()` to convey physically believable motion in animations. Read more at https://reactnative.dev/docs/easing|\n|style|[ViewStyle](https://reactnative.dev/docs/view-style-props)||Styles passed to the LinearGradient component|\n\n### ShimmerLayout props\n\n*Inherits most of [`GradientShimmer` props](#gradientshimmer-props)*\n\n|Name|Type|Description|\n|-|-|-|\n|layout|[`ShimmerLayoutContainerType`](#shimmerlayoutcontainertype)|Layout config tree|\n|defaultShimmerProps|[`GradientShimmer` props](#gradientshimmer-props)|Default props for GradientShimmer|\n\n### ShimmerLayoutContainerType\n\n|Name|Type|Description|\n|-|-|-|\n|flexDirection|'row' \\| 'column' \\| 'row-reverse' \\| 'column-reverse' \\| undefined|FlexBox flexDirection|\n|alignItems|`FlexAlignType`|FlexBox alignItems|\n|justifyContent|`FlexAlignType`|FlexBox justifyContent|\n|gap|`number`|Set the gaps (gutters) between rows and columns|\n|rowGap|`number`|Set the size of the gap (gutter) between an element's rows|\n|columnGap|`number`|Set the size of the gap (gutter) between an element's columns|\n|content|`Array\u003cShimmerLayoutItemType \\| ShimmerLayoutContainerType\u003e`|Children content layout|\n\n### ShimmerLayoutItemType\n\n|Name|Type|Description|\n|-|-|-|\n|width|`number`|Item `width` in DPI|\n|height|`number`|Item `height` in DPI|\n\n## Contribute\n\nNew features, bug fixes and improvements are welcome! For questions and suggestions use the [issues](https://github.com/douglasjunior/react-native-gradient-shimmer/issues).\n\n\u003ca href=\"https://www.patreon.com/douglasjunior\"\u003e\u003cimg src=\"http://i.imgur.com/xEO164Z.png\" alt=\"Become a Patron!\" width=\"200\" /\u003e\u003c/a\u003e\n[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://paypal.me/douglasnassif)\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=douglasjunior/react-native-gradient-shimmer\u0026type=Date)](https://star-history.com/#douglasjunior/react-native-gradient-shimmer)\n\n## License\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2023 Douglas Nassif Roma Junior\n```\n\nSee the full [license file](https://github.com/douglasjunior/react-native-gradient-shimmer/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasjunior%2Freact-native-gradient-shimmer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdouglasjunior%2Freact-native-gradient-shimmer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasjunior%2Freact-native-gradient-shimmer/lists"}