Elementary Carousel is a lightweight and easy-to-use carousel component for React applications. It provides a simple yet effective way to showcase content in a carousel format.
You can install Elementary Carousel via npm:
npm install elementary-carouselTo use Elementary Carousel in your React application, simply import it and render it with your desired content.
import React from 'react';
import ElementaryCarousel from 'elementary-carousel';
const CarouselExample = () => {
const carouselItems = [
{ id: 1, content: 'Slide 1' },
{ id: 2, content: 'Slide 2' },
{ id: 3, content: 'Slide 3' },
];
return (
<ElementaryCarousel items={carouselItems} />
);
};
export default CarouselExample;Elementary Carousel accepts the following props:
carouselContentArr: An array of objects representing the content to be displayed in the carousel. Each object should have a uniqueidand acontentproperty.
import React from 'react';
import ElementaryCarousel from 'elementary-carousel';
const BasicCarouselExample = () => {
const items = [
{ id: 1, content: 'Slide 1' },
{ id: 2, content: 'Slide 2' },
{ id: 3, content: 'Slide 3' },
];
return (
<ElementaryCarousel items={items} />
);
};
export default BasicCarouselExample;import React from 'react';
import ElementaryCarousel from 'elementary-carousel';
const CustomCarouselExample = () => {
const items = [
{ id: 1, content: 'Slide 1' },
{ id: 2, content: 'Slide 2' },
{ id: 3, content: 'Slide 3' },
];
return (
<ElementaryCarousel
items={items}
autoplay={false}
showArrows={false}
showDots={false}
/>
);
};
export default CustomCarouselExample;This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to customize the README as needed for your package!