react-swipeable-scroll-snap-carousel
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

react-swipeable-scroll-snap-carousel

A tiny swipeable carousel built with scroll snap for React

Features

  • Carousel by scroll-snap-type
  • Swipeable by mouse event
  • programmatically changed index

Getting Started

npm install react-swipeable-scroll-snap-carousel
import React, { useState } from 'react'
import { Carousel } from 'react-swipeable-scroll-snap-carousel'

function App() {
  const [index, setIndex] = useState(0)
  return (
    <Carousel index={index} onChangeIndex={setIndex}>
      <div style={{ backgroundColor: 'pink' }}>1</div>
      <div style={{ backgroundColor: 'skyblue' }}>2</div>
    </Carousel>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i react-swipeable-scroll-snap-carousel

Weekly Downloads

76

Version

0.0.5

License

MIT

Unpacked Size

7.98 kB

Total Files

8

Last publish

Collaborators

  • megos