With npm:
# new arch
npm install react-native-loader-kit
# old arch
npm install react-native-loader-kit@^2.0.0
With yarn:
# new arch
yarn add react-native-loader-kit
# old arch
yarn add react-native-loader-kit@^2.0.0
Run the following command to setup for iOS:
cd ios && pod install
# or
npx pod-install ios
You need to run prebuild
in order for native code takes effect:
npx expo prebuild
Then you need to restart your project to make changes take effect
// v3
import {
LoaderKitView,
} from 'react-native-loader-kit';
// v2
import LoaderKitView from 'react-native-loader-kit'
<LoaderKitView
style={{ width: 50, height: 50 }}
name={'BallPulse'}
animationSpeedMultiplier={1.0} // speed up/slow down animation, default: 1.0, larger is faster
color={'red'} // Optional: color can be: 'red', 'green',... or '#ddd', '#ffffff',...
/>
animationSpeedMultiplier
is only supported from v3
Common:
- BallPulse
- BallGridPulse
- BallClipRotate
- SquareSpin
- BallClipRotatePulse
- BallClipRotateMultiple
- BallPulseRise
- BallRotate
- CubeTransition
- BallZigZag
- BallZigZagDeflect
- BallTrianglePath
- BallScale
- LineScale
- LineScaleParty
- BallScaleMultiple
- BallPulseSync
- BallBeat
- LineScalePulseOut
- LineScalePulseOutRapid
- BallScaleRipple
- BallScaleRippleMultiple
- BallSpinFadeLoader
- LineSpinFadeLoader
- TriangleSkewSpin
- Pacman
- BallGridBeat
- SemiCircleSpin
- Orbit
- AudioEqualizer
- BallDoubleBounce
iOS only:
- BallRotateChase
- CircleStrokeSpin
You can override sdk version to use any version in your android/build.gradle
> buildscript
> ext
buildscript {
ext {
LoaderKit_kotlinVersion=2.0.21
LoaderKit_minSdkVersion=24
LoaderKit_targetSdkVersion=34
LoaderKit_compileSdkVersion=35
LoaderKit_ndkVersion=27.1.12297006
}
}
A fully working demo is located at example folder