react-native-animated-loading-button

1.0.1 • Public • Published

React Native Animated Loading Button

Actions Status npm Downloads

React Native Animated Loading Button is a button component that animates to a loading button and vice versa.

Installation

$ npm install react-native-animated-loading-button
$ yarn add react-native-animated-loading-button

Usage

import AnimatedLoadingButton from "react-native-animated-loading-button";
 
export default class View extends React.Component {
 
  loadingButton = React.createRef();
 
  showLoadingButton() {
    this.loadingButton.setLoading(true);
  }
 
  showButtonWithTitle() {
    this.loadingButton.setLoading(false);
  }
 
  render() {
    return <AnimatedLoadingButton
        ref={loadingButton => this.loadingButton = loadingButton}
        containerStyle={{
          width: "100%",
          height: 50
        }}
        buttonStyle={{
          backgroundColor: "#424242",
          borderRadius: 4,
          paddingHorizontal: 16
        }}
        title="Login"
        titleStyle={{
          color: "white"
        }}
        onPress={this.handleLoadingButtonPress}
      />
  }
}

Features

  • Animate to Loading State and vice versa.
  • Support Title.
  • Support Icon Left.
  • Support Icon Right.
  • Support Disabled button.
  • Support Raised button.
  • Supports Accessibility.

License

React Native Animated Loading Button is available under the MIT license. See LICENSE for details.

Package Sidebar

Install

npm i react-native-animated-loading-button

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

10.5 kB

Total Files

6

Last publish

Collaborators

  • philip-bui