carousel-component-react
v0.0.5
Published
A carousel component built with React and Vite. Uses pure-react-carousel for the carousel functionality.
Readme
Step By Step Traversal Component
A simple React component that allows sequential traversal through a list of components.
Example Usage
import { Carousel } from 'carousel-component-react';
import { ComponentOne } from './components/ComponentOne';
import { ComponentTwo } from './components/ComponentTwo';
import { ComponentThree } from './components/ComponentThree';
const componentList = [
ComponentOne,
ComponentTwo,
ComponentThree
];
function App() {
return (
<Carousel components={componentList} />
);
}Carousel-component-react and carousel-component-react-example-app are 2 separate npmjs packages. carousel-component-react contains just the carousel component whilst carousel-component-react-example-app also includes index.html and index.tsx so that you can view it as an react app using vite
Getting Started
Importing of
- Clone this repository:
git clone https://github.com/Pughal77/carousel-component-react.git- Install dependencies:
cd carousel-component
npm install- Run the example app:
npx viteImportant Notes
- Components passed to the
Carouselshould be simple components without props. Use currying or other methods to circumvent using a component with props - Navigation controls are provided by pure-react-carousell library
- The component handles state management internally
