React Native Progress Indicators

5.0.1 · active · verified Sun Apr 19

react-native-progress provides a suite of customizable progress indicators and spinners for React Native applications, leveraging either `react-native-svg` or the `react-native-art` package for rendering. It offers various styles including `Bar`, `Pie`, `Circle`, and `CircleSnail` components, allowing developers to visually represent asynchronous operations or loading states. The current stable version is 5.0.1, with a history of frequent updates to maintain compatibility with newer React Native versions and address rendering issues. Its key differentiators include a simple API for common progress types and the flexibility to opt out of the `react-native-svg` dependency if only the `ProgressBar` is needed via deep imports, making it adaptable to different project dependency profiles. The library ships with TypeScript typings, enhancing development experience for TypeScript users.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates how to import and use the various progress components (Bar, Pie, Circle, CircleSnail), showcasing both determinate and indeterminate states with custom styling.

import React from 'react';
import { View, StyleSheet, Text } from 'react-native';
import * as Progress from 'react-native-progress';

const App = () => {
  const progressValue = 0.6;
  const indeterminateValue = true;

  return (
    <View style={styles.container}>
      <Text style={styles.title}>Progress Bar</Text>
      <Progress.Bar progress={progressValue} width={200} color="#4CAF50" unfilledColor="#E0E0E0" />

      <Text style={styles.title}>Progress Pie</Text>
      <Progress.Pie progress={progressValue} size={80} color="#FFC107" unfilledColor="#E0E0E0" borderWidth={2} />

      <Text style={styles.title}>Progress Circle (Indeterminate)</Text>
      <Progress.Circle size={60} indeterminate={indeterminateValue} color="#2196F3" borderWidth={3} />

      <Text style={styles.title}>Circle Snail</Text>
      <Progress.CircleSnail 
        color={['#F44336', '#9C27B0', '#00BCD4']} 
        duration={1500}
        direction="counter-clockwise"
      />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
    paddingTop: 50,
    gap: 20
  },
  title: {
    fontSize: 18,
    fontWeight: 'bold',
    marginTop: 10
  }
});

export default App;

view raw JSON →