Git Product home page Git Product logo

react-carousel-3d's Introduction

React 3D Carousel component

3D carousel component in react (with swipe support).

Demo

Demo

jsfiddle (https://jsfiddle.net/suhailsulu/8hnqaz2c/)

Installation

npm

 npm i 3d-react-carousal

yarn

 yarn add 3d-react-carousal
Add fa-css in public.html for arrows
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
Importing the component
import {Carousel} from '3d-react-carousal';
.
.
.
let slides = [
    <img  src="https://picsum.photos/800/300/?random" alt="1" />,
    <img  src="https://picsum.photos/800/301/?random" alt="2" />  ,
    <img  src="https://picsum.photos/800/302/?random" alt="3" />  ,
    <img  src="https://picsum.photos/800/303/?random" alt="4" />  ,
    <img src="https://picsum.photos/800/304/?random" alt="5" />   ];
.
.
.
.
const callback = function(index){
    console.log("callback",index);
}
.
.
<Carousel slides={slides} autoplay={true} interval={1000} onSlideChange={callback}/>

props

slides :- Array of react components
autoplay :- Boolean (true or false) - optional
interval :- number (time in milliseconds) - optional
arrows :- Boolean (true or false) - optional
onSlideChange :- callback function with index of the slide as argument - optional
You can give any component in the slides like images, divs or even your custom components

react-carousel-3d's People

Contributors

dependabot[bot] avatar fabiiomariiano avatar johnaylingdi avatar lukereonal avatar mjsterling avatar ramesh-komarasamy-rs avatar suhailsulu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.