1.2.1 • Published 1 year ago

round-carousel-component v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Github Build Codacy Badge Codebeat Badge CodeFactor Badge DeepScan grade Analytics

Round Carousel

An infinitely scrollable 3D carousel component for the web

Demo

Visitor stats

GitHub stars GitHub forks GitHub watchers GitHub followers

Code stats

GitHub code size in bytes GitHub repo size GitHub language count GitHub top language GitHub last commit

Install

First install the component using your preferred package manager:

npm i round-carousel-component

# or

yarn add round-carousel-component

Usage

Then import the component in your application. Here is an example:

The slides (or items) should have the following shape:

PropTypeRequiredDescriptionExample
altstringfalseAlternative text for the slide image'This is an example alt text'
imagestringtruePath or URL to an image'https://source.unsplash.com/random/210x210'
contentstringtrueAn HTML string representing the content of the slide<div><strong>Slide Title</strong></div>
import { RoundCarousel, RoundCarouselItem } from 'round-carousel-component';

const node = document.getElementById('carousel');

// Create an array of Carousel Items
const items: RoundCarouselItem[] = Array(20)
	.fill('')
	.map((_, index) => ({
		alt: 'A random Unsplash photo',
		image: `https://picsum.photos/${210 + index}`,
		content: `<div><strong>Round Carousel</strong><span>Slide number ${index + 1}</span></div>`
	}));

new RoundCarousel(node, {
	items
});

Options

The component accepts the following configuration options as props:

PropTypeRequiredDescriptionDefault
itemsRoundCarouselItemtrueAn array of RoundCarouselItems[]
itemWidthnumberfalseWidth of each of the carousel items210
nextButtonContentstringfalseContent of the next button'Next'
prevButtonContentstringfalseContent of the previous button'Previous'
showControlsbooleanfalseShow/hide navigation controlstrue

LICENSE

MIT



1.2.1

1 year ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.0.0

3 years ago