Socket
Socket
Sign inDemoInstall

rn-slide-button

Package Overview
Dependencies
521
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rn-slide-button

A simple slide button using Reanimated 2 animation library.


Version published
Weekly downloads
368
decreased by-13.62%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

React Native Slide Button

A simple slide button using Reanimated 2 animation library.

Preview

@

Installation

npm install --save rn-slide-button

or

yarn add rn-slide-button

Dependencies

yarn add react-native-gesture-handler react-native-reanimated

Usage

import SlideButton from 'rn-slide-button';

// ...
<SlideButton title="Slide To Unlock"/>;
// ...

Component props

proptypedefaultdescription
widthnumberscreen widthbutton width.
heightnumber60button height.
borderRadiusnumber30button corner radius.
completeThresholdnumber70determinates whether the thumb will reach to the end or to start. (value should be 0-100)
paddingnumber5button content padding.
disabledbooleanfalsechanges button touchability.
reverseSlideEnabledbooleantrueenable/disable thumb's back sliding feature
titlestringSlide to savebutton title.
titleStyleobjectobjectbutton title styling.
titleContainerStyleobjectobjectbutton title container styling.
iconImage/ Elementnullthumb icon.
thumbStyleobjectobjectthumb container styling.
containerStyleobjectobjectbutton container styling.
underlayStyleobjectobjectthumb underlay view styling.
autoResetbooleanfalsethumb will reset its position if it's set to true
autoResetDelaynumber1080msdelay time to reset
animationbooleanfalsethum will animate if it's set to true
animationDurationnumber180msanimation duration time
onSlideStartfunc() => {}it will be invoked when sliding starts
onSlideEndfunc() => {}it will be invoked when sliding ends
onReachedToStartfunc() => {}it will be invoked when thumb reaches to start
onReachedToEndfunc() => {}it will be invoked when thumb reaches to end

License

MIT

Keywords

FAQs

Last updated on 16 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc