Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rn-slide-to-confirm

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-slide-to-confirm

Slide to confirm for React Native

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34
decreased by-70.43%
Maintainers
1
Weekly downloads
 
Created
Source

rn-slide-to-confirm

Slide to confirm button for react native

Demo

Installation

  npm i rn-slide-to-confirm

Basic usage

import React, { useState } from 'react';
import { View } from 'react-native';
import SlideToConfirm from 'rn-slide-to-confirm';

const Slider = () => {
    const [sliderState, setSliderState] = useState(false);

    return (
        <View>
            <SlideToConfirm
                unconfimredTipText={"Slide to confirm"}
                unconfirmedTipTextStyle={{
                    color: "white",
                    fontSize: 18
                }}

                confirmedTipText={"Confirmed"}
                confirmedTipTextStyle={{
                    color: "white",
                    fontSize: 18
                }}
                state={sliderState}
                onSlideConfirmed={() =>setSliderState(true)}
                sliderStyle={{
                    justifyContent: 'center',
                    width: 300,
                    height: 40,
                    borderRadius: 8,
                    overflow: 'hidden',
                }}
            />
        </View>
    );
}

export default Slider;

Props

PropTypeDescription
onSlidecallbackcallback while sliding
onSlideEndcallbackcallback when sliding ended
onSlideReleasecallbackcallback when sliding released
onSlideBegincallbackcallback when sliding begin
onSlideConfirmedcallbackcallback when sliding confirmed
onSlideNotConfirmedcallbackcallback when sliding not confirmed
defaultColorstringset default color for all components (default is "#5920BC")
defaultIconSizenumberset icon size (default is 30)
tipAnimationEnablebooleanset slider tip animation (default is true)
tipTextSlideAnimEnablebooleanset tip text animation (default is true)
sliderTipDurationnumberduration time for slide tip animation (default is 300)
sliderTipDistanceFromLeftnumberdistance from left when slide tip animation started (default is 40)
goToBackDurationnumberduration time for go back after slide ending or not confirmed (default is 300)
confirmedPercentnumberrange: 0 - 1 , slider will be confirmed at this percent of the width of the slider (default is 0.8)
ballPaddingnumberpadding of slider ball - left and right. this is recommended prop for adding padding to an inside component of the slider (default is 0)
disableOnConfirmedbooleandisables gesture handler after sliding confirmed default(false)
statebooleancurrent state of slider. This is recommended prop for changing state of slider. it helps you to change state after an action with pretty animation (default is false)
unconfimredTipTextstringshown text in slider before confirmed (while slider is unconfimred). default is ""
confirmedTipTextstringshown text in slider while slider is confirmed. default is ""
confirmedTipTextStylestyleconfirmed tip text style
unconfirmedTipTextStylestyleunconfirmed tip text style
sliderStylestylecustom slider container style. Don't forget making overflow:"hidden" in custom style. because inside component of slider can go out of box
sliderButtonComponentcomponentcustom slider button component. you can create your custom inside component of slider container

Keywords

FAQs

Package last updated on 02 Jul 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc