npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-slide-button

v2.0.0

Published

Custom react slide button for both desktop and mobile.

Downloads

1,534

Readme

react-slide-button

Custom react slide button for both desktop and mobile. This button uses react-swipeable to detect the swipe action.

Installation

npm install --save react-slide-button

or

yarn add react-slide-button

Demo / Example

Click here

Options

| Key | Type | Default | Description | | ---------------- | ------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | mainText | string | react node | | Element that appears on button | | overlayText | string | react node | | Element that appears on slide overlay | | onSlideDone | function | | Callback that gets called when the button is slide complete | | reset | integer | | If this value changes, the button is reset to initial state, i.e., non-slide state. | | caret | string | react node | | Element to serve as new caret, default is an image of arrow. | | customCaretWidth | integer | 40 | Caret Width. | | classList | string | '' | Class names that gets appended to main button element | | overlayClassList | string | '' | Class names that gets appended to overlay element | | caretClassList | string | '' | Class names that gets appended to caret element | | delta | integer | 10 | Minimum distance to slide before swiping animation starts | | minSlideWidth | float | 0.6 | Minimum width that a user needs to slide till to change the button state to slide state. Value ranges from 0-1. For example, 0.6 means user needs to slide atleast till 60% of total width of button to set it to slide state. | | minSlideVelocity | float | 0.6 | Other way to change button state to slide is to slide it quickly. If the slide velocity is above this value then button is set to slide state. |

Note: Even if user slides to lesser distance than the one specified by minSlideWidth option, if his slide velocity is above minSlideVelocity the button state will be changed to slide.


Development

Firstly move on the Package Folder.

cd package

then install the dependencies with npm install or yarn install.

Now , use the following command to create a link locally, which is to be used in example project, using the following command

npm link

Now start the automatic rebuild for hot reloading purpose using the command:

npm start

Keep this terminal opened and move onto next step.

Now you need to start the example project, to do this make sure your current directory is /example, install its dependencies too using npm install or yarn install command. Now link react-slide-button to the example project using the command:

npm link react-slide-button

Now you can start the example project by running the command:

npm start

Now you are ready to make changes to /src/index.js file.