Code Monkey home page Code Monkey logo

react-native-submit-button's Introduction

react-native-submit-button

An Animated Submit Button. Works on both android and IOS.

  • folds when in progress
  • expands back when its ready

Alt text

Inspiration

https://dribbble.com/shots/1426764-Submit-Button

Running Example

  • git clone https://github.com/ronak301/react-native-submit-button.git
  • cd example
  • npm install
  • rnpm link
  • react-native run-ios

Installation

  • npm install --save react-native-submit-button
  • if RN > 0.29 react-native link else rnpm link

Usage

import SubmitButton from 'react-native-submit-button';

class SubmitButtonExample extends Component {
  render() {
    return (
      <View style={{flex:1}}>
        <SubmitButton />
      </View>
    ); 
  } 
}

Props

Property Type Default Description
primaryColor string rgb(30, 205, 151) optional user-defined primary color
secondaryColor string white optional user-defined secondary color
buttonState string normal button state can be one of normal, success, error
width number 180 optional user-defined width for button
height number 54 optional user-defined height for button
buttonText string 'Submit' optional user-defined text on button
buttonTextWhenReady string optional user-defined text on button when success (either provide this or give iconName to be shown once submitted successfully ) , this will get priority over icon name
iconName string 'check' optional any icon name from fontello icons , to be shown once we got success.
textStyle object optional text styles to override existing styles
buttonStyle object optional button styles to override existing styles
animationDuration number 200 number in ms. Time to fold button.
errorColor string #ff6666 error color
onSubmit function function to call on button press
onSuccess function function to call on success
onError function function to call on error

License

  • MIT. © Ronak Kothari

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.