"/> ">

Home  >  Article  >  Web Front-end  >  How to show progress bar in ReactNative?

How to show progress bar in ReactNative?

WBOY
WBOYforward
2023-09-10 20:37:011119browse

ProgressBar is a way of telling the user that content will be available at some point. It's best used when you are submitting content to the server and waiting for the server to respond.

To use the progress bar component, please use npm to install the react-native-paper module.

The command to install react-native-paper is-

npm install --save-dev react-native-paper

The basic composition of the progress bar is as follows-

<ProgressBar progress={progress_number} color="progresscolorbar" />

To use the progress bar, you need to install it from react-native-paper Import it as shown below -

import { ProgressBar} from &#39;react-native-paper&#39;;

Here are some important properties available on ProgressBar-

Sr.No Props Vs. Description
1 Progress

The value range is 0 to 10. The value to be displayed in the progress bar.

2 Color

The color of the progress bar.

3 It can be seen that the

value is true/false. It helps to show/hide progress bar.

4 style

The style applied to the progress bar.

Example: Displaying a progress bar

Displaying a progress bar is very simple. Just import it from react-native-paper first.

import { ProgressBar} from &#39;react-native-paper&#39;;

The code to display the progress bar is as follows -

<ProgressBar style={{ marginTop:200}} progress={0.5} color="#00BCD4" />

The default value is 0.5 and will increase to 10.

import * as React from 'react';
import { ProgressBar} from &#39;react-native-paper&#39;;
const MyComponent = () => (
   <ProgressBar style={{ marginTop:200}} progress={0.5} color="#00BCD4" />
);
export default MyComponent;

Output

How to show progress bar in ReactNative?

The above is the detailed content of How to show progress bar in ReactNative?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete