Giter Club home page Giter Club logo

react-native-shimmer-kit's Introduction

React Native Shimmer Kit

A JavaScript library used for creating shimmer effect in React Native.

npm

Get Started

Install library

Using Yarn

yarn add react-native-shimmer-kit

Or using NPM

npm install react-native-shimmer-kit --save

Install dependencies

For React Native CLI:

Using Yarn

yarn add react-native-linear-gradient

Or using NPM

npm install react-native-linear-gradient --save

Note: checkout react-native-linear-gradient for more information.

For Expo Go:

expo install expo-linear-gradient

Note: checkout expo-linear-gradient for more information.

Configure for iOS

Run cd ios && pod install

Configure for Android

No additional set up necessary.

Usage

React Native CLI:

import Shimmer from 'react-native-shimmer-kit';

const YourShimmer = () => (
  <Shimmer
    width={120}
    height={120}
    borderRadius={60}
    duration={3000}
    colors={['#93C5FD', '#BFDBFE', '#BFDBFE', '#93C5FD']}
  />
);

Expo Go:

import {LinearGradient as ExpoLinearGradient} from 'expo-linear-gradient';
import Shimmer from 'react-native-shimmer-kit';

const YourShimmer = () => (
  <Shimmer
    width={120}
    height={120}
    borderRadius={60}
    duration={3000}
    colors={['#93C5FD', '#BFDBFE', '#BFDBFE', '#93C5FD']}
    LinearGradientComponent={ExpoLinearGradient} // <~ required this for expo project
  />
);

Props

Prop Description Required Type Default
width width of shimmer number undefined
height height of shimmer number undefined
borderRadius the radius of the shimmer's corners number 0
marginVertical the top-bottom margin of shimmer number 0
marginHorizontal the left-right margin of shimmer number 0
marginTop the right margin of shimmer number 0
marginBottom the bottom margin of shimmer number 0
marginLeft the left margin of shimmer number 0
marginRight the right margin of shimmer number 0
colors array of colors for gradient background string[] ['#E6E6E6', '#f5f5f5', '#f5f5f5', '#E6E6E6']
duration duration of shimmer over a row number 1500
islooped loop the animation boolean true
isReversed reverse direction of the animation boolean false
customStyle custom style for shimmer ViewStyle undefined
LinearGradientComponent LinearGradient components ('react-native-linear-gradient' or 'expo-linear-gradient') React component react-native-linear-gradient

react-native-shimmer-kit's People

Contributors

dependabot[bot] avatar taingoo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.