react-touch-carousel is a micro carousel framework for React.JS that prioritizes highly customizable user experiences over predefined configurations. Instead of offering numerous options for static DOM nodes, it employs an inversion of control pattern, allowing developers to fully dictate content rendering and styling dynamically. Its current stable version is 0.10.2, and releases appear tied to updates in its underlying animation library, `react-spring`, rather than a fixed cadence. This differentiates it significantly from more opinionated carousel libraries like Swiper or Slick, providing unparalleled flexibility for bespoke designs and advanced UI requirements where designers demand specific, non-standard behaviors.
npm install react-touch-carouselVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic looping carousel with autoplay functionality. It shows how to provide a custom container component and a card renderer, leveraging `listOfData` to dynamically display content with custom styling and animations via inline styles and `transform` properties.
Replace `props.stiffness` with `props.tension` and `props.damping` with `props.friction` when configuring spring animations.
Be aware of the increased bundle size. If bundle size is critical, consider analyzing the impact or exploring alternatives if the new features are not strictly necessary.
Always check release notes for `react-touch-carousel` and `react-spring` when upgrading to ensure compatibility and understand potential behavioral shifts.
Update your code to use `tension` instead of `stiffness` and `friction` instead of `damping` for spring configurations.
Change `import { TouchCarousel } from 'react-touch-carousel';` to `import TouchCarousel from 'react-touch-carousel';`