Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-load-shimmer

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-load-shimmer

Simple loading shimmer for React Native

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28
increased by47.37%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-load-shimmer

Add a simple shimmer effect to any UI loading state. No native dependencies!

Installation

yarn add react-native-load-shimmer

Properties

PropDescriptionRequired
childrenReact native elements that you want to apply a shimmer toY
isShimmeringBoolean - Dictates whether shimmer effect is occurringY
containerStyleStyle to apply to wrapper on shimmer componentN
shimmerConfigConfig object for shimmer effectY

Shimmer Config Options

KeyDescriptionRequiredDefault
skewXSlant applied to shimmerN"-30deg"
gradientWidthWidth of each gradientN20
startXStarting position for shimmer effectNVariable
durationDuration in ms of 1 loop of shimmer effectN1500
useNativeDriverUses the native driver when true.NTrue
shimmerColorColor of shimmer effect. Should match background of screen.Y
toValueEnding position of shimmer effectNVariable
opacityArrArray of opacity values to create shimmerN[.05, .15, .25, .3, .35, .3, .25, .15, .05]

Usage

/**
 * @flow strict-local
 */

import React from 'react';
import Shimmer from 'react-native-simple-shimmer';

export default function LoadingWithShimmer({children}) {
  const shimmerConfig = {
    startingX: -200,
    useNativeDriver: true,
    shimmerColor: '#FFF',
    toValue: Dimensions.get('window').width + 100,
  };

  return (
      <SafeAreaView>
        <ScrollView
          style={styles.scrollView}>
          <Shimmer shimmerConfig={shimmerConfig} containerStyle={containerStyle} isShimmering={true}>
            {children}
          </Shimmer>
        </ScrollView>
      </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  scrollView: {
    backgroundColor: 'white',
  },
});

License

MIT License. react-native-load-shimmer is under MIT license. © Kevin DeArmond 2020 - present

Keywords

FAQs

Package last updated on 22 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc