GithubHelp home page GithubHelp logo

renadr / nice-react-carousel Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 5.56 MB

A carousel for your React project ๐ŸŽ 

Home Page: https://nice-react-carousel.netlify.com

License: MIT License

JavaScript 4.63% TypeScript 82.91% HTML 12.46%
react carousel javascript typescript styled-components hooks

nice-react-carousel's Introduction

๐ŸŽ 
nice-react-carousel

A nice carousel for your React project.
npm npm NPM

Try it

https://nice-react-carousel.netlify.com

Install it

npm

npm i nice-react-carousel

yarn

yarn add nice-react-carousel

Use it

import Carousel from 'nice-react-carousel';

Documentation

Option Type Default Description
mode string ('normal', 'center' 'variableWidth') 'normal' How items should be displayed.
itemsBySlide number 1 Items number for each slide. Works only with 'normal' mode.
space number 10 Space between each item (px).
itemsWidth number 100 Width of each item(px). Works only with 'variableWidth' mode.
arrows boolean true Should show the arrow buttons (previous/next) when it's possible.
dots `function boolean` false
customNextArrow ReactElement Custom the next button.
customPrevArrow ReactElement Custom the previous button.
responsive Object{breakpoint: number, ...} Change properties depending on the breakpoint (Mobile first).

Basic example

<Carousel mode="normal" itemsBySlide={2} dots>
  <div>Slider 1</div>
  <div>Slider 2</div>
  <div>Slider 3</div>
</Carousel>

Props usage examples

  • Custom dots :
  dots = {active => {
    return (
      <span>[{active ? 'x': ''}]</span>
    );
  }}
  • Responsive (Mobile first) :
  responsive = {[
    {
      breakpoint:800,
      space: 10,
      itemsWidth: 200
    },
    {
      breakpoint:1200,
      space: 15,
      itemsWidth: 250,
      dots: false,
    },
  ]}

Help ?

Open an issue for all your question, request or anything else just here :

https://github.com/renadr/nice-react-carousel/issues

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.