3.0.0 • Published 1 year ago

expo-shimmer-placeholder v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Get Started

Fork of https://www.npmjs.com/package/react-native-shimmer-loading to only require expo-linear-gradient as react-native-linear-gradient was causing issues

Installation

npm i expo-shimmer-placeholder --save

or

yarn add expo-shimmer-placeholder

Usage

Simple

import { createShimmerPlaceHolder } from 'expo-shimmer-placeholder'
import { LinearGradient } from 'expo-linear-gradient'
const ShimmerPlaceHolder = createShimmerPlaceHolder(LinearGradient)

<ShimmerPlaceHolder />
<ShimmerPlaceHolder visible={isFetched}>
  <Text>
    Wow, awesome here.
  </Text>
</ShimmerPlaceHolder>

Connect more components

More Detail see this

Props

PropDescriptionTypeDefault
LinearGradientLinear Gradient components ('expo-linear-gradient')Componentundefined
visibleVisible child componentsbooleanfalse
styleContainer StyleStyle{backgroundColor: '#ebebeb',overflow: 'hidden'}
shimmerStyleShimmer Style onlyStyle{}
contentStyleContent Style when visibleStyle{}
locationLocations of shimmernumber[]0.3, 0.5, 0.7
widthWidth of rownumber200
durationDuration of shimmer over a rownumber1000
heightHeight of rownumber15
shimmerWidthPercentPercent of shimmer widthnumber1.0
isReversedReverse direction of animationbooleanfalse
stopAutoRunStop running shimmer animation at beginningbooleanfalse
isInteractionDefines whether or not the shimmer animation creates an interaction handle on the InteractionManagerbooleantrue
shimmerColorsColors of the shimmer.string[]'#ebebeb', '#c5c5c5', '#ebebeb'
containerPropsProps passed to the outermost ViewViewPropsundefined
shimmerContainerPropsProps passed to the View which contains the loading animationViewPropsundefined
childrenContainerPropsProps passed to the View which contains the childrenViewPropsundefined

Methods

MethodDescriptionType
getAnimatedget Animated of PlaceholderAnimated

Helpers

createShimmerPlaceHolder

Contribute

Welcome help me to build this awesome lib.

License

MIT

3.0.0

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago