Vibary.ai
← Vibe Coding

Carousel Slide Advance

Slides advance with the neighbours peeking, dots tracking position.

navigationelegantenergeticinteraction · finite · intermediate · ~0.4s
Interactive · click to play
Variant

The animated component in this preview is rendered from the canonical file shown here. The surrounding demo shell only provides context and is not part of the copied code.

424 lines · react + motion only
import { useEffect, useId, useState } from "react";
import { motion, useAnimationControls, useReducedMotion } from "motion/react";

/**
 * Vibary · Carousel Slide Advance
 *
 * A gallery that moves one slide at a time. The neighbours stay visible
 * at the edges so the strip reads as a row you are moving along rather

About this pattern

A gallery you move along rather than page through. Two choices do the work: the viewport is narrower than the track so the neighbour on each side stays visible, and the accent dot is a single marker with a shared layout id, so it travels to the position you landed on instead of blinking out and back. Arrows, dots and a horizontal drag all funnel into one settle function, which is why a flick that does not commit snaps back through exactly the same spring as a button press. Neighbours recede with opacity alone — scaling them down would scale their captions, and text that resizes as it drifts past is the tell of a cheap gallery.

Product image galleryPromo strip on a home pageTestimonial rotatorMedia browser

Where it shows up

Screens we drew to show where this motion usually sits. Illustrations, not captures of any product.

  • NewMenWomenSale
    Men's trail shoeRidgeline GT$132Bone
    88.599.510
    Add to bag
    Free delivery and returns
    Product details
    Product page

    Photos advance one at a time with dots underneath marking the position.

Related patterns