Indicator

January 16, 2023 ยท View on GitHub

Indicator component can be used while fetching data from API or also can be used when a user navigates between screens.

๐ŸŽฌ Preview


Indicator
alt_tag

Usage

Different types of variants are present in the Indicator component. The Indicator component's usage is demonstrated below.


import React from 'react';
import { StyleSheet, View } from 'react-native';
import { IndicatorEnum, SkiaIndicator } from 'react-native-skia-catalog';

const IndicatorScreen = () => (
  <View style={styles.container}>
    <SkiaIndicator
      type={IndicatorEnum.BALL}
      color={'#FF5252'}
      width={60}
      height={60}
      borderRadius={30}
      animating={true}
      progressDuration={800}
    />
  </View>
);

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

export default IndicatorScreen;

Properties

PropsDefaultTypeDescription
type-BALL / BAR / CIRCLE /DOT / MATERIAL / PAC_MAN / PULSE / SKYPE / UI_ACTIVITY / WAVE / BREATHING / ROTATION_CIRCLE / ROTATION_HOLEType of Indicator. Note: IndicatorEnum can be used to specify the type. Ex. IndicatorEnum.WAVE.
color#E65100string / number / Float32ArrayColor of Indicator.
width-numberWidth of Indicator.
height-numberHeight of Indicator.
borderRadius-numberBorder Radius of Indicator.
animating-booleanIt use for animate or stop Indicator.
progressDuration-numberSpeed of Indicator.
animationEasing-(arg: number) => numberThis functions specify the rate of change of a parameter over time.
count-numberNumber of dots or line in Indicator. It is not applicable to the PULSE BALL/ BREATHING/ MATERIAL/ PAC MAN/ CIRCLE/ ROTATION CIRCLE Indicator.
onTouch-TouchHandlerThis callback function is triggered when you press the Indicator.
opacity-SkiaMutableValue<number>Opacity of Indicator.
style-ViewStyleThis style is applied to the component Indicator.
minScale0.2numberIt is minimum scale value of the dot in SKYPE indicator.
maxScale1numberIt is maximum scale value of the dot in SKYPE indicator.
trackWidth-numberStroke width in outline type circle Indicator. In UI_ACTIVITY indicator, it's responsible for line width.
waveFactor0.54numberIt use for scaling WAVE animation.
waveMode"fill""fill" / "outline"It determines how a wave circle looks, whether it fills or outlines in WAVE indicator.
direction"counter-clockwise""clockwise" / "counter-clockwise"It controls whether the MATERIAL Indicator moves in a clockwise or counterclockwise way. It is also responsible for hole movement in ROTATION_HOLE and ROTATION_CIRCLE indicator.
reversefalsebooleanIt is responsible for the DOT indicator's movement direction. whether it is from left to right or from right to left.
circleColor#E65100string / Float32Array / numberIt is color of hole in ROTATION_HOLE and ROTATION_CIRCLE indicator.

๐ŸŽฌ Preview Example


Indicator