React Spring Carousel


Ok so, how do I build a slideshow? Well, of course, that's a pretty easy thing to do with React Spring Carousel 🤟

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

  export function Component() {
    const { 
    } = useTransitionCarousel({
      items: (
        <CarouselItem color={i.color}>

    useEffect(() => {
      const timer = setInterval(() => {
      }, 1500);
      return () => {
      // You MUST add the slide methods to the dependency list useEffect!
    }, [slideToNextItem]);

    return (
        <button onClick={slideToPrevItem}>Prev item</button>
        <button onClick={slideToNextItem}>Next item</button>
You may wonder why I didn't add this simple functionality inside the carousel. The answer is simple: I don't want to force you to do the things in my way - aka the way I think it could be better. Like I give you the methods to trigger the carousel navigation, and you decide who and when someone will trigger the carousel navigation, I give you total freedom about implementation your own fade in slideshow. Or whatever you want to do :)