Socket
Socket
Sign inDemoInstall

react-spring-carousel

Package Overview
Dependencies
3
Maintainers
1
Versions
282
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-spring-carousel

A new <Carousel /> experience for the web


Version published
Weekly downloads
5.2K
decreased by-37.91%
Maintainers
1
Install size
5.02 MB
Created
Weekly downloads
 

Readme

Source

A performant React carousel component powered by react-spring and @use-gesture.

NPM NPM

Install

// npm v7.x
npm install --save react-spring-carousel
// npm v6.x or less
npm install --save react-spring react-spring-carousel
yarn add react-spring react-spring-carousel

Usage

import { useSpringCarousel } from 'react-spring-carousel'

const { carouselFragment, slideToPrevItem, slideToNextItem } = useSpringCarousel({
  items: [
    {
      id: 'item-1',
      renderItem: <div>Item 1</div>,
    },
    {
      id: 'item-2',
      renderItem: <div>Item 2</div>,
    },
  ],
})

return (
  <div>
    <button onClick={slideToPrevItem}>Prev item</button>
    <div>{carouselFragment}</div>
    <button onClick={slideToNextItem}>Next item</button>
  </div>
)

Official documentation

For a complete overview of the library, please visit the official documentation.

Visit here

Keywords

FAQs

Last updated on 15 May 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc