1.2.2 • Published 3 years ago

@simonpatrat/react-roll v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

React Roll

Actions Coverage Badge

Simple carousel component for React

Storybook demo.


How to use

npm i @simonpatrat/react-roll

or

yarn add @simonpatrat/react-roll

Basic usage

import React from "react";
import { Carousel } from "@simonpatrat/react-roll";

export default function MyCarousel() {
  return (
    <Carousel>
      {/* Each child is now a Slide */}
      <div>Hello</div>
      <div>World</div>
      <div>I am a slide</div>
    </Carousel>
  );
}

Advanced usage

import React from "react";
import { Carousel } from "@simonpatrat/react-roll";

export default function MyCarousel() {
  return (
    <Carousel
      autoFocus
      className="my-carousel"
      locale="en"
      numVisibleSlides={4}
      onChangeSlide={() => {}}
      responsive={{
        768: {
          numVisibleSlides: 1,
          paddingRight: "30%",
        },
        1024: {
          numVisibleSlides: 2,
          paddingRight: "20%",
        },
        1366: {
          numVisibleSlides: 3,
        },
      }}
      slidePadding="8px"
    >
      {/* Each child is now a Slide */}
      <div>Hello</div>
      <div>World</div>
      <div>I am a slide</div>
    </Carousel>
  );
}

Todo

  • Better documentation on props (see storybook docs)
  • Async Slide Component
  • Improve Control buttons (positioning)
  • Typescript
  • scss support
  • Storybook
  • Full size option
  • Infinite slides option
  • Scrollable carousel option
  • Tests
1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.2

3 years ago

0.0.40

3 years ago

0.0.41

3 years ago

0.0.42

3 years ago

0.0.43

3 years ago

0.0.35

3 years ago

0.0.36

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.37

3 years ago

0.0.38

3 years ago

0.0.39

3 years ago

0.0.34

3 years ago

0.0.33

3 years ago