项目作者: philip-bui

项目描述 :
React Native Animated Loading Button.
高级语言: JavaScript
项目地址: git://github.com/philip-bui/react-native-animated-loading-button.git
创建时间: 2019-11-03T00:15:13Z
项目社区:https://github.com/philip-bui/react-native-animated-loading-button

开源协议:MIT License

下载




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

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

Usage

  1. import AnimatedLoadingButton from "react-native-animated-loading-button";
  2. export default class View extends React.Component {
  3. loadingButton = React.createRef();
  4. showLoadingButton() {
  5. this.loadingButton.setLoading(true);
  6. }
  7. showButtonWithTitle() {
  8. this.loadingButton.setLoading(false);
  9. }
  10. render() {
  11. return <AnimatedLoadingButton
  12. ref={loadingButton => this.loadingButton = loadingButton}
  13. containerStyle={{
  14. width: "100%",
  15. height: 50
  16. }}
  17. buttonStyle={{
  18. backgroundColor: "#424242",
  19. borderRadius: 4,
  20. paddingHorizontal: 16
  21. }}
  22. title="Login"
  23. titleStyle={{
  24. color: "white"
  25. }}
  26. onPress={this.handleLoadingButtonPress}
  27. />
  28. }
  29. }

Features

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

License

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