
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
react-carousel
Advanced tools
A carousel.
.react-carousel
.react-carousel__navigation-button .react-carousel__navigation-button--previous
ul
li
.react-carousel__navigation-button .react-carousel__navigation-button--next
Refer to demo for a complete setup.
<Carousel
controlWidth={50}
itemWidth={240}
itemMargin={20}
>
<div>foo</div>
<div>bar</div>
<div>baz</div>
</Carousel>
git clone https://github.com/gajus/react-carousel.git
cd ./react-carousel/demo
npm install
npm start
The component does very little by itself. You provide it the input with props, and it renders it. To make any changes (like change active item, scroll items), you need to change props that you pass to it
Ideally, you keep state in a (redux) store, and pass that state as props to this component. The callbacks are used to manipulate the store which shall eventually change the props passed, and render the component.
The component will show scroll buttons (two buttons; one in front of the carousel and one at the end) if number of items in the carousel exceed the total number of items that can be displayed without overflowing the contents.
The total number of items that can be displayed in the carousel is determined using the width of the component container, the itemWidth property value and itemMargin property value.
The carousel shrinks if the container width can't be filled with items.
onItemActivate will be given the key of the item that is clicked by the user.
onItemScroll gets called when user clicks on next/ previous scroll button. It gives index of the new firstVisibleIndex item.
/**
* Called when user clicks on an item.
*
* @typedef Carousel~onItemActivate
* @property {String} Key prop of the item
*/
/**
* Called when user clicks on buttons to scroll items (next or previous)
*
* @typedef Carousel~onItemScroll
* @property {Number} index Index to scroll to
*/
/**
* @property {Carousel~controlWidth} Width of the carousel navigation button.
* @property {Carousel~firstVisibleIndex} Index to which the carousel is scrolled to (i.e the first index which is visible.) (default: `0`).
* @property {Carousel~itemMargin} Margin between two items in the carousel.
* @property {Carousel~itemWidth} Width of an item.
* @property {Carousel~onItemActivate} Called when user clicks on an item.
* @property {Carousel~onItemScroll} Called when user clicks on control buttons.
* @property {Carousel~scrollStepDistance} Number of items to scroll at one time (default: the current visible item count).
*/
FAQs
React carousel.
The npm package react-carousel receives a total of 201 weekly downloads. As such, react-carousel popularity was classified as not popular.
We found that react-carousel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.