
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
styled-components-carousel
Advanced tools
A simple React Carousel component written in Typescript and built with [styled-components](https://github.com/styled-components/styled-components) using React Hooks.
A simple React Carousel component written in Typescript and built with styled-components using React Hooks.
Heavily inspired by react-slick with a simplified API and small behaviour changes.

This component expects that you will have the following packages installed:
npm install styled-components-carousel
yarn add styled-components-carousel
import Carousel from 'styled-components-carousel';
const Example = () => (
<Carousel
center
infinite
showArrows
showIndicator
slidesToShow={3}
>
<div>
<span>1</span>
</div>
<div>
<span>2</span>
</div>
<div>
<span>3</span>
</div>
</Carousel>
);
You can define custom settings per breakpoint for truly responsive behaviour.
import Carousel from 'styled-components-carousel';
const Example = () => (
<Carousel
slidesToShow={3}
center
centerPadding={30}
breakpoints={[
{
size: 200,
settings: {
slidesToShow: 1,
showArrows: false,
showIndicator: false,
swipeable: true,
},
},
{
size: 600,
settings: {
slidesToShow: 3,
showArrows: false,
showIndicator: true,
swipeable: true,
},
},
{
size: 1000,
settings: {
slidesToShow: 4,
showArrows: true,
showIndicator: true,
center: true,
swipeable: true,
},
},
]}
>
<div>
<span>1</span>
</div>
<div>
<span>2</span>
</div>
<div>
<span>3</span>
</div>
</Carousel>
);
| Prop | Type | Required | Description | Default |
|---|---|---|---|---|
| center | boolean | No | Should the items be centered? | False |
| infinite | boolean | No | Should the carousel infinitely scroll the items | False |
| showIndicator | boolean | No | Should the bottom item indicator be shown? | True |
| showArrows | boolean | No | Should the side navigation arrows be shown? | True |
| swipeable | boolean | No | Is the carousel swipeable? | True |
| debug | boolean | No | A dev helper prop for debugging development | False |
| slidesToShow | number | No | The number of slides to show at once. | 1 |
| scaleOnFocus | number | No | How much should the focused item scale? | 1 |
| centerPadding | number | No | Used in conjunction with center property to adding padding to center card | 0 |
| breakpoints | array | No | An array of settings in order to have responsive behaviour for different screen sizes | undefined |
yarn storybook
yarn test
yarn build
FAQs
A simple React Carousel component written in Typescript and built with [styled-components](https://github.com/styled-components/styled-components) using React Hooks.
We found that styled-components-carousel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.