GithubHelp home page GithubHelp logo

harpalsinh-jadeja / rnslidingbutton Goto Github PK

View Code? Open in Web Editor NEW
19.0 0.0 8.0 661 KB

React Native Button component which support Slide event to perform action.

JavaScript 58.06% Python 9.61% Java 7.92% Objective-C 24.41%
sliding-button animation button-animation button-slider slide swipe react-native-button

rnslidingbutton's Introduction

React Native Sliding Button

npm version

React Native Button component which support Slide event to perform action.It support only slideComplete event not tappe event.

rnslidingbutton

Installation.

Install the package with NPM.

npm install rn-sliding-button --save

Or with YARN

yarn install rn-sliding-button

How to use.

Very simple to use just add this component in your file.

// import packages
import {RNSlidingButton, SlideDirection} from 'rn-sliding-button';

// use in your class
onSlideRight = () => {
    //perform Action on slide success.
};

<RNSlidingButton
  style={{
    width: 240
  }}
  height={35}
  onSlidingSuccess={this.onSlideRight}
  slideDirection={SlideDirection.RIGHT}>
  <View>
    <Text numberOfLines={1} style={styles.titleText}>
      SLIDE RIGHT TO ACCEPT >
    </Text>
  </View>
</RNSlidingButton>

const styles = StyleSheet.create({
    titleText: {
        fontSize: 17,
        fontWeight: 'normal',
        textAlign: 'center',
        color: '#ffffff'
    }
});

API

SlidingButton

Prop Type Default Description
height number Height of button
slideDirection string SlideDirection.RIGHT Determines which direction to slide. Either SlideDirection.LEFT, SlideDirection.RIGHT, SlideDirection.BOTH.
onSlidingSuccess function Fired when slide succeeds
onSlide function Fired on every movement. Distance of movement is passed as argument.
successfulSlidePercent number Percent of total button width needed to slide before movement is seen as a successful slide. Default is 40.

rnslidingbutton's People

Contributors

harpalsinh-jadeja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rnslidingbutton's Issues

Missing default param for Animated.timing

Hello!

Awesome little component but I noticed this warning Animated 'useNativeDriver' was not specified. This is a required option and must be explicitly set to 'true' or 'false'.

This can be fixed by adding useNativeDriver: false to each of the Animated.timing calls in the options.

IMG_A6AD81457B9B-1

Cheers

Could not find a declaration file for module 'rn-sliding-button'

This is the whole warning I have got
Could not find a declaration file for module 'rn-sliding-button'. '/hamza/Desktop/BestWebMobile/Mister_Delivery/md-mobile-app/node_modules/rn-sliding-button/index.js' implicitly has an 'any' type. Try npm install @types/rn-sliding-buttonif it exists or add a new declaration (.d.ts) file containingdeclare module 'rn-sliding-button';ts(7016)

RTL issues

I used I18n Manager for right to left language configuration.
I18nManager.forceRTL(isRTLSupported);
But this library is not supporting RTL configuration.
Sliding is not working properly in RTL language.

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.