Giter VIP home page Giter VIP logo

react-native-micro-animated-button's Introduction

react-native-micro-animated-button

npm version

Installation

yarn add react-native-vector-icons react-native-micro-animated-button

react-native-vector-icons may require native linking, see package repository for more details (not needed if using Expo).

Definition

type props = {
  activeOpacity?: number,
  backgroundColor?: string,         // default = white
  bounce?: boolean,                 // default = false
  disabled?: boolean,               // default = false
  disabledBackgroundColor?: string, // default = gray
  disabledForegroundColor?: string, // default = white
  errorBackgroundColor?: string,    // default = red
  errorForegroundColor?: string,    // default = white
  errorIcon?: string,
  errorLabel?: string,
  expandOnFinish?: boolean,         // default = false
  foregroundColor?: string,         // default = blue
  icon?: string,                    // default = icons names from iconSet
  iconSet? any,                     // default = FontAwesome
  iconSize?: number,                // default = 17
  iconStyle?: Object,
  initialState?: 'success' | 'error' | 'loading',
  label?: string,
  labelStyle?: Object,              // default = defaultLabelStyle
  material?: boolean,               // use MaterialIcons instead of FontAwesome
  maxWidth?: number,                // default = 240
  minWidth?: number,                // default = 40
  noBorder?: boolean,               // default = false
  noFill?: boolean,                 // default = false
  noRadius?: boolean,               // default = false
  onError?: Function,
  onLoad?: Function,
  onPress?: Function,
  onReset?: Function,
  onSecondaryPress?: Function,
  onSuccess?: Function,
  renderErrorIcon?: any,            // default = <FontAwesome />
  renderIndicator?: any,            // default = <ActivityIndicator />
  renderLabel?: any,                // default = <Text />
  renderSuccessIcon?: any,          // default = <FontAwesome />
  scaleFactor?: number,             // default = 1.1
  scaleOnSuccess?: boolean,         // default = false
  shakeOnError?: boolean,           // default = false
  static?: boolean,                 // default = false
  style?: Object,                   // default = defaultStyle
  successBackgroundColor?: string,  // default = green
  successForegroundColor?: string,  // default = white
  successIcon?: string,
  successLabel?: string,
  width?: number,                   // overwrites maxWidth and minWidth, use for fixed length
};

const defaultStyle = {
  alignItems: 'center',
  borderRadius: 20,
  borderWidth: 1,
  height: 40,
  justifyContent: 'center',
  marginVertical: 10
};

const defaultLabelStyle = {
  backgroundColor: 'transparent',
  padding: 10
};

// methods
button.success(); // Animate button to success state
button.error();   // Animate button to error state
button.load();    // Animate button to loading state
button.reset();   // Animate button to initial/default state

// usage
import Btn from 'react-native-micro-animated-button';

<Btn
  label="Submit"
  onPress={() => this.btn.success()}
  ref={ref => (this.btn = ref)}
  successIcon="check"
/>

Examples

Available here.

react-native-micro-animated-button's People

Contributors

andrfas avatar nnals avatar sonaye avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.