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

react-native-gradient-shimmer

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-gradient-shimmer

⚛ A pure JavaScript, performant, typed shimmer component for Android and iOS.

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
179
decreased by-45.26%
Maintainers
1
Weekly downloads
 
Created
Source

React-Native Gradient Shimmer

License MIT npm version npm downloads

⚛ A pure JavaScript, performant, typed shimmer component for Android and iOS.

It uses React Native Animated API for animation, and expo-linear-gradient or react-native-linear-gradient for the gradient effect.

AndroidiOS

Requirements

Install

Install dependency package

yarn add react-native-gradient-shimmer

Or

npm i -S react-native-gradient-shimmer

Basic usage

Render the GradientShimmer directly:

import LinearGradient from 'react-native-linear-gradient'; // or 'expo-linear-gradient'
import GradientShimmer from 'react-native-gradient-shimmer';

const App = () => {
   return (
      <SafeAreaView style={{flex: 1}}>
         <PdfRendererView
            LinearGradientComponent={LinearGradient}
            backgroundColor="red"
            highlightColor="blue"
            height={120}
            width={120}
            style={{
              borderRadius: 60,
              margin: 8,
            }}
         />
      </SafeAreaView>
   );
}

export default App;

Or create your own GradientShimmer instance with default props:

import LinearGradient from 'react-native-linear-gradient'; // or 'expo-linear-gradient'
import {createGradientShimmer} from 'react-native-gradient-shimmer';

const CustomGradientShimmer = createGradientShimmer({
  backgroundColor: 'red',
  highlightColor: 'blue',
  LinearGradientComponent: LinearGradient,
})

const App = () => {
   return (
      <SafeAreaView style={{flex: 1}}>
         <CustomGradientShimmer
            height={120}
            width={120}
            style={{
              borderRadius: 60,
              margin: 8,
            }}
         />
      </SafeAreaView>
   );
}

export default App;

GradientShimmer props

NameValueDefaultDescription
LinearGradientComponentComponentTypeLinear gradient component from expo-linear-gradient or react-native-linear-gradient
widthnumberComponent width in DPI
heightnumberComponent height in DPI
backgroundColorstring'rgb(255,255,255)'Background color in HEX or RGB
highlightColorstring'rgb(200,200,200)'Highlight color in HEX or RGB
scalenumber20Scale factor to customize the highlight size
durationnumber1500Duration of the animation in milliseconds
styleViewStyleStyles passed to the LinearGradient component

Contribute

New features, bug fixes and improvements are welcome! For questions and suggestions use the issues.

Become a Patron! Donate

Star History

Star History Chart

License

The MIT License (MIT)

Copyright (c) 2023 Douglas Nassif Roma Junior

See the full license file.

Keywords

FAQs

Package last updated on 04 Apr 2023

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