Progress Steps

Published in UI
July 26, 2022
1 min read
Progress Steps

Introduction

A simple and fully customizable React Native component that implements a progress stepper UI. Each steps content is displayed inside of a customizable ScrollView. Fully customizable buttons are displayed at the bottom of the component to move between steps.

Installation

npm i react-native-progress-steps

Example

import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { ProgressSteps, ProgressStep } from 'react-native-progress-steps';
class ExampleTwo extends Component {
static navigationOptions = {
header: null
};
defaultScrollViewProps = {
keyboardShouldPersistTaps: 'handled',
contentContainerStyle: {
flex: 1,
justifyContent: 'center'
}
};
onNextStep = () => {
console.log('called next step');
};
onPrevStep = () => {
console.log('called previous step');
};
onSubmitSteps = () => {
console.log('called on submit step.');
};
render() {
const progressStepsStyle = {
activeStepIconBorderColor: 'lightblue',
activeLabelColor: 'black',
activeStepNumColor: 'black',
activeStepIconColor: 'lightblue',
completedStepIconColor: 'lightgreen',
completedProgressBarColor: 'lightgreen',
completedCheckColor: 'green'
};
const buttonTextStyle = {
color: '#686868',
fontWeight: 'bold'
};
return (
<View style={{ flex: 1, marginTop: 50 }}>
<ProgressSteps {...progressStepsStyle}>
<ProgressStep
label="First"
onNext={this.onNextStep}
onPrevious={this.onPrevStep}
scrollViewProps={this.defaultScrollViewProps}
nextBtnTextStyle={buttonTextStyle}
previousBtnTextStyle={buttonTextStyle}
>
<View style={{ alignItems: 'center' }}>
<Text>This is the content within step 1!</Text>
</View>
</ProgressStep>
<ProgressStep
label="Second"
onNext={this.onNextStep}
onPrevious={this.onPrevStep}
scrollViewProps={this.defaultScrollViewProps}
nextBtnTextStyle={buttonTextStyle}
previousBtnTextStyle={buttonTextStyle}
>
<View style={{ alignItems: 'center' }}>
<Text>This is the content within step 2!</Text>
</View>
</ProgressStep>
<ProgressStep
label="Third"
onNext={this.onNextStep}
onPrevious={this.onPrevStep}
scrollViewProps={this.defaultScrollViewProps}
nextBtnTextStyle={buttonTextStyle}
previousBtnTextStyle={buttonTextStyle}
>
<View style={{ alignItems: 'center' }}>
<Text>This is the content within step 3!</Text>
</View>
</ProgressStep>
<ProgressStep
label="Fourth"
onNext={this.onNextStep}
onPrevious={this.onPrevStep}
scrollViewProps={this.defaultScrollViewProps}
nextBtnTextStyle={buttonTextStyle}
previousBtnTextStyle={buttonTextStyle}
>
<View style={{ alignItems: 'center' }}>
<Text>This is the content within step 4!</Text>
</View>
</ProgressStep>
<ProgressStep
label="Fifth"
onPrevious={this.onPrevStep}
onSubmit={this.onSubmitSteps}
scrollViewProps={this.defaultScrollViewProps}
nextBtnTextStyle={buttonTextStyle}
previousBtnTextStyle={buttonTextStyle}
>
<View style={{ alignItems: 'center' }}>
<Text>This is the content within step 5!</Text>
</View>
</ProgressStep>
</ProgressSteps>
</View>
);
}
}
export default ExampleTwo;

Tutorial


Share


Next Article
Counter
Awesome React Native
© 2025, All Rights Reserved.

Social Media