1.0.4 • Published 3 years ago

rn-animated-loading-button v1.0.4

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

npm version npm Platform - Android and iOS License: MIT styled with prettier

Screenshots

Source code copied and edit from https://github.com/philip-bui/rn-animated-loading-button , because of personal reason (custom something that it cant be normally).

Installation

Add the dependency:

yarn add rn-animated-loading-button

Peer Dependencies

"react": ">= 16.x.x",
"react-native": ">=0.63.x"

Usage

Import

import AnimatedLoadingButton from "rn-animated-loading-button";

Fundamental Usage

<AnimatedLoadingButton
  containerStyle={styles.submitButtonContainer}
  buttonStyle={styles.submitButton}
  title="Submit"
  titleStyle={styles.submitText}
  ref={(r) => (buttonRef = r)}
  onPress={onPress}
/>

const styles = StyleSheet.create({
  submitButtonContainer: {
    height: 40,
    width: 150,
  },
  submitButton: {
    backgroundColor: '#0D6CEC',
    borderRadius: 50,
  },
  submitText: {
    fontSize: 18,
    color: '#FFFFFF',
  },
});

Example Project 😍

You can checkout the example project 🥰

Simply run

  • npm i
  • npx react-native run-ios/android

should work of the example project.

Configuration - Props

Fundamentals

PropertyTypeDefaultDescription
titlestringundefinedchange the title

Customization (Optionals)

PropertyTypeDefaultDescription
disabledbooleanfalselet you enable the button (must use it for button)
onPressfunctionundefinedset your own logic for the button functionality when it is pressed
containerStyleViewStyledefaultset or override the style object for the main container
titleStyleViewStyledefaultset or override the style object for the button title
buttonStyleViewStyledefaultset or override the style object for the button style
loadingStyleViewStyledefaultset or override the style object for the loading style
TouchableComponentImagedefaultset your own component instead of default react-native Image component
useNativeDriverbooleanfalseset your own component instead of default react-native Image component
TouchableComponentImagedefaultset your own component instead of default react-native Image component
TouchableComponentImagedefaultset your own component instead of default react-native Image component
TouchableComponentImagedefaultset your own component instead of default react-native Image component
TouchableComponentImagedefaultset your own component instead of default react-native Image component

Future Plans

  • LICENSE
  • Write an article about the lib on Medium

Change Log

Change log will be here !

Author

jeremaihloo, jeremaihloo1024@gmail.com

License

React Native Typescript Library Starter is available under the MIT license. See the LICENSE file for more info.