0.6.0 ā€¢ Published 12 months ago

react-beautiful-carousel v0.6.0

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

react-beautiful-carousel

šŸ”— Codesandbox Example

Code Example

App.js

import React from "react";
import { Carousel, CarouselItem } from "react-beautiful-carousel";
import "react-beautiful-carousel/style.css";
import "./style.css";

export default function App() {
  return (
    <div className="App">
      <div className="wrraper">
        <Carousel showArrows showDots className="custom-class">
          <CarouselItem className="custom-class-item">
            <div>1</div>
          </CarouselItem>
          <CarouselItem className="custom-class-item">
            <div>2</div>
          </CarouselItem>
          <CarouselItem className="custom-class-item">
            <div>3</div>
          </CarouselItem>
        </Carousel>
      </div>
    </div>
  );
}

style.css

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.App {
  height: 100vh;
  background-color: #f5f5f5;

  display: grid;
  place-items: center;
}

.wrraper {
  width: 500px;
  height: 200px;
}

/* Note:  you can use the default classNames, check it in the devtool */
.custom-class {
  border: 2px solid red;
}

.custom-class-item {
  height: 100%;
  font-size: 3rem;

  display: grid;
  place-items: center;

  border: 1px solid black;
}

Carousel

propstypedescriptiondefault
childrenReact.ReactElement[]an array of CarouselItem[]
showArrowsbooleanwill show the (horizontal) arrowsfalse
arrowsPropsCarouselArrowPropscustomize arrows by colors, classes, etcfalse
showDotsbooleanwill show the dots to easily navigate between itemsfalse
dotsPropsCarouselDotsPropscustomize dots by colors, size, classes, etcfalse
initialActivenumber?set first active frame0
disableSwipeboolean?if true, the carousel won't be swipablefalse
...restReact.HTMLAttributesany other valid HTML attribute.undefind

CarouselItem

propstypedescriptiondefault
childrenReact.ReactNodeany jsx elementsundefind
...restReact.HTMLAttributesany other valid HTML attribute.undefind

CarouselSlider

propstypedescriptiondefault
childrenReact.ReactElement[]an array of CarouselItem[]
showArrowsbooleanwill show the (horizontal) arrowsfalse
arrowsPropsCarouselArrowPropscustomize arrows by colors, classes, etcfalse
initialActivenumber?set first active frame0
disableSwipeboolean?if true, the carousel won't be swipablefalse
...restReact.HTMLAttributesany other valid HTML attribute.undefind
0.6.0

12 months ago

0.5.3

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.5.0

1 year ago

0.0.55

1 year ago

0.0.5

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago