0.1.0 • Published 2 years ago

@hoverspaces/swipeable-screens v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

react-swipeable-views-2

Description

This project lets you swipe swipe on the present component left and right to move the renderer to the component on the right and component on the left respectivly. You can set up an array of components to be selected back and forth.

Installation

npm install --save react-swipeable-views-2

Usage

components to be shown as the swipeable screen is written inside the project component as shown below.

import React,{useState} from 'react';
import SwipeableScreens from 'react-swipeable-views-2'

export default function MyComponent(){

const[slide,set_slide]=useState(0);

return(

 <SwipeableScreens currentSlide={slide} onChange={(val)=>set_slide(val)} className="w-full">
       
        <div className="w-full bg-green-500">
           slide number 1
         </div>

          <div className="w-full bg-red-500">
           slide number 2
         </div>

          <div className="w-full bg-yellow-400">
           slide number 3
         </div>

          <div className="w-full bg-blue-500">
           slide number 4
         </div>

</SwipeableScreens>

);
}