Skip to main content

ProgresStepperLive

ProgressStepperLive

Usage

ProgressStepperLive is a single page progress stepper component where the main emphasis is showing an ongoing sequence of events.

App.js

import React, { useState } from "react";
import { View, StyleSheet, Button } from "react-native";

import { ProgressStepperLive } from "react-native-reanimated-progress-steps";

function App() {
const [current, setCurrent] = useState(0);
return (
<View style={styles.container}>
<ProgressStepperLive
allSteps={["Step 1", "Step 2", "Step3"]}
showLabels
stepGap={10}
trackBackgroundColor="white"
progressColor="red"
trackCompletedColor="green"
currentStep={current}
animationVariation="live"
animationDuration={2000}
trackHeight={8}
/>
<Button onPress={() => setCurrent(current + 1)} title="Next" />
<Button onPress={() => setCurrent(current - 1)} title="Prev" />
</View>
);
}

export default App;

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

The above code produces the following

Animation Presets

Currently three types of animation variations are supported. animationVariation could be live , scaleToFill or bounce

scaleToFill variation with animationDuration set to 1000

bounce variation with animationDuration set to 500

Props

NameDefault ValueDescription
currentStep0The current step in the progress stepper.
allSteps['Menu', 'Cart', 'Checkout', 'Delivery']An array containing all the steps in the progress stepper.
showLabelstrueIndicates whether to show labels for each step.
widthwindowWidth - 20The overall width of the progress stepper.
stepGap10The gap between each step in the progress stepper.
containerStyleStyle for the container of the progress stepper.
trackHeight8The height of the progress track.
trackBackgroundColor'#DEDEDE'The background color of the progress track.
progressColor'red'The color of the current progress in the track.
trackCompletedColor'red'The color of completed progress in the track.
labelStyleStyle for the labels in the progress stepper.
animationVariation'scaleToFill'Type of animation variation, either 'scaleToFill' or 'live'.
animationDuration1000Duration of the animation.