An open API service indexing awesome lists of open source software.

https://github.com/emiliano-bucci/react-spring-carousel

A new Carousel experience for the web.
https://github.com/emiliano-bucci/react-spring-carousel

carousel js react react-carousel react-slider react-spring react-spring-carousel react-spring-slider slider touch

Last synced: about 2 months ago
JSON representation

A new Carousel experience for the web.

Awesome Lists containing this project

README

        

# react-spring-carousel

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

[![NPM](https://img.shields.io/npm/v/react-spring-carousel.svg)](https://www.npmjs.com/package/react-spring-carousel) [![NPM](https://img.shields.io/bundlephobia/minzip/react-spring-carousel)](https://img.shields.io/bundlephobia/minzip/react-spring-carousel)

## Install

```bash
// npm v7.x
npm install --save react-spring-carousel
```

```bash
// npm v6.x or less
npm install --save react-spring react-spring-carousel
```

```bash
yarn add react-spring react-spring-carousel
```

## Usage

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

const { carouselFragment, slideToPrevItem, slideToNextItem } = useSpringCarousel({
items: [
{
id: 'item-1',
renderItem:

Item 1
,
},
{
id: 'item-2',
renderItem:
Item 2
,
},
],
})

return (


Prev item
{carouselFragment}

Next item

)
```

## Official documentation

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

[Visit here](https://react-spring-carousel.emilianobucci.com)