button-with-spinner

    1.0.3 • Public • Published

    button-with-spinner

    This is a react native custom button component which supports in react native 0.60 and above. During API call’s or any time consuming operation, user will be visually informed from the button itself. This custom button will display a spinner when it is clicked to inform user that some processing is going and block the UI until processing is complete.

    Getting started

    $ npm install button-with-spinner --save

    or

    $ yarn add button-with-spinner

    Mostly automatic installation

    For react native version < 0.60, call react-native link before proceeding. $ react-native link button-with-spinner

    Follow the below steps, for all versions of react native that supports pod. $ cd ios $ pod install

    Usage

     
    import SaveButton from 'button-with-spinner';
     
    // Add a state in constructor with name isLoading and update it based on the operation performed
     
    <SaveButton
    style={{marginTop: 16}}
    buttonStyle={{backgroundColor:'blue'}}
    title={"Save"}
    isLoading={this.state.isLoading}
    onButtonPress={(value) => {
      console.log("Spinner started. It will stop when this.state.isLoading is set to false");
    }}/>
     

    Install

    npm i button-with-spinner

    DownloadsWeekly Downloads

    30

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    226 kB

    Total Files

    58

    Last publish

    Collaborators

    • shwetap