šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

react-swipeable-button

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-swipeable-button

A react component to create swipeable button in react

1.0.5
Source
npm
Version published
Weekly downloads
251
-13.75%
Maintainers
1
Weekly downloads
Ā 
Created
Source

react-swipeable-button

A npm pacakge for Swipeable button in react

NPM install size npm bundle size

Install

npm install react-swipeable-button

or

yarn add react-swipeable-button

Demo

react-swipeable-button

Usage

You need to wrap a parent div to set the width, height and background color of the button.

import { SwipeableButton } from "react-swipeable-button";

function App() {
  const onSuccess = () => {
    console.log("Successfully Swiped!");
  };

  return (
    <div className="w-[500px] h-[100px] bg-white">
      <SwipeableButton
        onSuccess={onSuccess}
        text="Swipe to get to know us!"
        text_unlocked="Swiped!"
        color="#000"
      />
    </div>
  );
}

export default App;

Props

text (Default will be 'SWIPE') The text that will display on the swipe button

text_unlocked (Default will be 'UNLOCKED!') The text that will display on the swipe button

color The color of swipe button

onSuccess The function that will get called when a swipe is success

Future Updates

Contributing on this project is always welcome! Just fork, update, push to your respective branch and make a pull request after testing.

TypeScript support is coming soon.

License

MIT Ā© Abdur Rahman

Keywords

react swipeable button

FAQs

Package last updated on 28 Feb 2024

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