@dajk/react-carousel

0.0.0-alpha.7 • Public • Published

react-carousel

Carousel for React

npm codecov npm bundle size

Install

npm install @dajk/react-carousel

or

yarn add @dajk/react-carousel

Usage

import React from 'react'
import Carousel from '@dajk/react-carousel'

export const items = [
  { backgroundColor: 'blue', color: 'white' },
  { backgroundColor: 'red', color: 'white' },
  { backgroundColor: 'green', color: 'white' },
  { backgroundColor: 'yellow', color: 'black' },
]

const MyCarousel = () => {
  return (
    <Carousel>
      {items.map((item, index) => {
        return (
          <div
            key={index}
            style={{
              height: 200,
              display: 'flex',
              alignItems: 'center',
              justifyContent: 'center',
              ...item,
            }}
          >
            {index}
          </div>
        )
      })}
    </Carousel>
  )
}

License

MIT © dajk

Readme

Keywords

none

Package Sidebar

Install

npm i @dajk/react-carousel

Weekly Downloads

0

Version

0.0.0-alpha.7

License

MIT

Unpacked Size

34.8 kB

Total Files

14

Last publish

Collaborators

  • dajk