1.0.1 • Published 5 years ago

react-native-loading-button-with-animation v1.0.1

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

react-native-loading-button-with-animation

Install

npm install react-native-loading-button-with-animation --save

Example

import LoadingButton from "react-native-loading-button-with-animation";

export default class example extends Component {
  constructor(props) {
    super(props);
    this.state = {
      isLoading: false
    };
  }

  onPressHandler() {
    this.setState({ isLoading: true });
    setTimeout(() => {
      this.setState({ isLoading: false });
    }, 1000);
  }

  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>Welcome to React Native!</Text>
        <LoadingButton
          disabled={!!this.state.isLoading}
          onPress={this.onPressHandler.bind(this)}
          isLoading={this.state.isLoading}
        />
      </View>
    );
  }
}

Props

NameDetail & TypeDefault
onPressButton On press callback (function)alert('press')
isLoadingStart or stop animation booleanfalse
activityIndicatorColorActivity Indicator Color (string)'#FFF'
activityIndicatorSizeActivity Indicator Size (string)'small'
viewStyleMain View style (object)'small'
animationDelayHow manny time will tack to animate (number)200
whenAnimationViewWidthMain view size when animated40
enableWidthAnimationChange width when animationtrue
childViewInner child ComponentText Component (OK)
disabledDisables TouchableOpacity while loadingtrue