HomeOur TeamContact

Progress Simple Dialog

By Utkarsh Lubal
Published in Modal
May 06, 2023
1 min read
Progress Simple Dialog

Table Of Contents

01
Introduction
02
Installation
03
Example
04
Tutorial

Introduction

Progress Simple Dialog is a useful component for React Native developers who want to add a simple and customizable dialog to their mobile applications. It provides a loading indicator with a message, which is commonly used in applications to indicate that something is happening in the background.

The component is easy to use and can be installed through npm. Once installed, it can be imported into your React Native application. The component takes a few props, such as visible, message, and indicatorColor, which allow you to customize the appearance and behavior of the dialog to suit your application’s needs.

One of the primary features of Progress Simple Dialog is its ability to control its visibility through the visible prop. This prop allows you to toggle the visibility of the dialog based on specific actions, such as a button press or the completion of an asynchronous task.

Additionally, the message prop allows you to display a message to the user while the loading indicator is displayed. This message can be customized to provide context to the user about what is happening in the background.

Finally, the indicatorColor prop lets you set the color of the loading indicator in the dialog. This prop is useful for matching the color scheme of your application or for providing visual feedback to the user about the status of the operation.

Overall, Progress Simple Dialog is a great component for developers who want to add a simple and customizable loading dialog to their React Native applications. It is easy to use, has several useful props, and can be customized to fit your application’s needs.

Installation

npm install react-native-dialogs –save

Or

yarn add react-native-dialogs

Example

import React, { Component } from "react";
import {
    Button,
    StyleSheet,
    View,
} from "react-native";
import {  ProgressDialog } from "react-native-simple-dialogs";

const styles = StyleSheet.create({
    container: {
        alignItems: "center",
        backgroundColor: "#F5FCFF",
        flex: 1,
        justifyContent: "center",
    },

});

class Example extends Component {
    state = {}

    openProgress = () => {
        this.setState({ showProgress: true });

        setTimeout(
            () => {
                this.setState({ showProgress: false });
            },
            4000,
        );
    }

    render() {
        return (
            <View style={ styles.container }>

                <Button
                    onPress={ this.openProgress }
                    title="Progress Dialog"
                />

                <ProgressDialog
                    title="Progress Dialog"
                    activityIndicatorColor="blue"
                    activityIndicatorSize="large"
                    animationType="slide"
                    message="Please, wait..."
                    visible={ this.state.showProgress }
                />
            </View>
        );
    }
}

export default Example;

Tutorial

Coming Soon…


Previous Article
Pulse Loader
Utkarsh Lubal

Utkarsh Lubal

Full Stack Developer

Related Posts

Confirm Simple Dialog
Confirm Simple Dialog
May 06, 2023
1 min

Quick Links

Advertise with usAbout UsContact Us

Social Media