• Stars
    star
    700
  • Rank 64,671 (Top 2 %)
  • Language
    Java
  • License
    MIT License
  • Created over 8 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple shimmering effect for any view in React Native

react-native-shimmer

Simple shimmering effect in React Native. Based on Shimmer/shimmer-android.

Shimmer

Installation

yarn add react-native-shimmer
cd ios && pod install
Installation for React Native <= 0.59

Option: With CocoaPods

Add the following to your Podfile and run pod update:

pod 'react-native-shimmer', :path => 'node_modules/react-native-shimmer'

Option: With react-native link

$ react-native link react-native-shimmer

Option: Manually

iOS

Add ios/RNShimmer.xcodeproj to Libraries and add libRNShimmer.a to Link Binary With Libraries under Build Phases. More info and screenshots about how to do this is available in the React Native documentation.

Android

  • Edit android/settings.gradle to look like this (without the +):
rootProject.name = 'MyApp'

include ':app'

+ include ':react-native-shimmer'
+ project(':react-native-shimmer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-shimmer/android')
  • Edit android/app/build.gradle (note: app folder) to look like this:
apply plugin: 'com.android.application'

android {
  ...
}

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile "com.android.support:appcompat-v7:23.0.1"
  compile "com.facebook.react:react-native:+"  // From node_modules
+ compile project(':react-native-shimmer')
}
  • Edit your MainApplication.java (deep in android/app/src/main/java/...) to look like this (note two places to edit):
package com.myapp;

+ import com.oblador.shimmer.RNShimmerPackage;

....

  @Override
  protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
      new MainReactPackage()
+   , new RNShimmerPackage()
    );
  }

}

Usage

NOTE: Shimmer may only have one child.

import Shimmer from 'react-native-shimmer';

<Shimmer>
  <Text>Loading...</Text>
</Shimmer>;

Properties

Prop Description Default
animating Whether or not to show shimmering effect. true
direction The direction of shimmering animation, valid values are up, down, left, right. right
duration The shimmering animation duration in milliseconds. 1000
pauseDuration The time interval between shimmerings in milliseconds. 400
animationOpacity The opacity of the content while it is shimmering. 1
opacity The opacity of the content before it is shimmering. 0.5
highlightLength The highlight length of shimmering. Range of 0–1. iOS only 1
beginFadeDuration The duration of the fade used when shimmer begins. iOS only 0
endFadeDuration The duration of the fade used when shimmer ends. iOS only 0
tilt The tilt angle of the highlight, in degrees. Android only 0
intensity The intensity of the highlight mask. Range of 0–1. Android only 0

License

MIT License. Shimmer is under BSD license. © Joel Arvidsson 2016 - present

More Repositories

1

react-native-vector-icons

Customizable Icons for React Native with support for image source and full styling.
JavaScript
17,427
star
2

react-native-animatable

Standard set of easy to use animations and declarative transitions for React Native
JavaScript
9,838
star
3

react-native-progress

Progress indicators and spinners for React Native
JavaScript
3,628
star
4

hush

🤫 Noiseless Browsing – Content Blocker for Safari
JavaScript
3,264
star
5

react-native-keychain

🔑 Keychain Access for React Native
Kotlin
3,194
star
6

react-native-lightbox

Images etc in Full Screen Lightbox Popovers for React Native
JavaScript
2,818
star
7

react-native-collapsible

Animated collapsible component for React Native, good for accordions, toggles etc
JavaScript
2,450
star
8

loki

👁 Visual Regression Testing for Storybook
JavaScript
1,778
star
9

react-native-image-progress

Progress indicator for networked images in React Native
JavaScript
1,723
star
10

angular-scroll

Scrollspy, animated scrollTo and scroll events for angular.js
JavaScript
1,482
star
11

react-native-performance

📐 Monitor and measure React Native performance
TypeScript
929
star
12

react-native-store-review

Rate on App/Play Store directly in your React Native app
Java
751
star
13

react-native-esbuild

Fast bundler and dev server for react-native using esbuild
JavaScript
595
star
14

react-native-parallax

Parallax effects for React Native using Animated API
JavaScript
585
star
15

react-native-vector-image

iOS/Android native vector assets generated from SVG
JavaScript
310
star
16

react-native-pinchable

Instagram like pinch to zoom for React Native
Java
225
star
17

angular-parallax

Lightweight & performant parallax scrolling for angular.js.
JavaScript
203
star
18

angular-lazytube

Lightweight, responsive, lazy loaded YouTube videos that degrades gracefully.
JavaScript
45
star
19

diglett

Keep your JS project lean by detecting duplicate dependencies
JavaScript
44
star
20

esbuild-server

Fast, lightweight and powerful development server for esbuild
TypeScript
38
star
21

react-native-oxc

10x your react-native builds with OXC
TypeScript
28
star
22

oblador.github.io

Landing page for my GitHub projects
HTML
10
star
23

oblador

5
star
24

node-cloud-imager

Powerful yet simple way to apply filters/crop/resize images and upload to cloud providers (Amazon S3, Rackspace, Azure).
JavaScript
3
star
25

node-ups-sdk

JavaScript
3
star
26

sovra

🤏 Rust-based Test Decider for JavaScript using Oxc
Rust
2
star
27

expo-requestidlecallback-issue

TypeScript
1
star
28

react-native-android-autolinking-bug-repro

TypeScript
1
star
29

.github

1
star
30

react-native-fabric-image-unicode-issue

TypeScript
1
star