Giter Site home page Giter Site logo

jaagrav / react-pretty-carousel Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 3.0 223 KB

Easily add beautiful carousels to your website in no time!

Home Page: https://react-pretty-carousel.herokuapp.com/

JavaScript 90.66% CSS 9.34%
javascript react carousel carousel-component package react-components carousel-slider

react-pretty-carousel's Introduction

React-Pretty-Carousel

Easily add beautiful carousels to your website in no time!

React Pretty Carousel

Check out the Demo on the docs website!

Installation

In order to install react-pretty-carousel, run this command in your terminal.

npm i react-pretty-carousel --save

Or

yarn add react-pretty-carousel

Usage

Usage

Props

Prop DataType Description
items integer Number of items to display at once
mode string Style of the carousel, can be either normal or gallery
showControls boolean Show the dots and navigation buttons if true, and otherwise if false

External Functions and Values

You can summon and move/navigate through the carousel by importing and using the following functions:

import {
  CarouselWrapper,
  prev,
  next,
  moveTo,
  switchTo,
  presentIndex,
} from "react-pretty-carousel";
Function Description Parameters
prev() Move to the previous slide none
next() Move to the next slide none
moveTo(5) Move to a certain index/object with smooth animation integer
switchTo(5) Abruptly move to a certain index/object integer
presentIndex Get the present index of the carousel object being displayed none

react-pretty-carousel's People

Contributors

jaagrav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-pretty-carousel's Issues

Carousel auto play

Hello, any idea how to make the carousel start automatically?

Thanks!

TypeError: Cannot read properties of null (reading 'parentElement')

I have two page in my react application.

  1. Home page (where I have used this react-pretty-carousel)
  2. Sign page (simple form page)

When I switch from Home page to Sign page (using react-router-dom Routes, Navlink, etc) I face this issues.

Console (this error repeats to infinte in console) :-

Uncaught TypeError: Cannot read properties of null (reading 'parentElement')
at reactToStyle (CarouselItem.js:10)

Uncaught TypeError: Cannot read properties of null (reading 'classList')
at CarouselDots.js:20

Uncaught TypeError: Cannot read properties of null (reading 'classList')
at CarouselDots.js:22

Uncaught TypeError: Cannot read properties of null (reading 'parentElement')
at reactToStyle (CarouselItem.js:10)
Uncaught TypeError: Cannot read properties of null (reading 'classList')
at CarouselDots.js:20
Uncaught TypeError: Cannot read properties of null (reading 'classList')
at CarouselDots.js:22
Uncaught TypeError: Cannot read properties of null (reading 'parentElement')
at reactToStyle (CarouselItem.js:10)
reactToStyle @ CarouselItem.js:10
setInterval (async)
Uncaught TypeError: Cannot read properties of null (reading 'classList')
at CarouselDots.js:20
Uncaught TypeError: Cannot read properties of null (reading 'classList')
at CarouselDots.js:22

Please look into it and help to fix this.

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.