Vibary.ai
← Vibe Coding

Variant Swatch Switch

Choosing a colorway crossfades the product while one selection ring travels to the swatch.

commerceelegantfriendlyinteraction · 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.

322 lines · react + motion only
import { useId, useState } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";

/**
 * Vibary · Variant Swatch Switch
 *
 * Picking a colorway crossfades the product to its new finish while the
 * selection ring travels to the swatch you chose — one ring that moves,

About this pattern

Two things have to agree the instant a finish is chosen: the picture and the marker. The product crossfades to the new colorway with a short directional slide so the swap has a heading, and a single selection ring travels along the swatch row on a shared layout animation rather than one ring fading out while another fades in. The finish name shares a grid cell with itself across the swap, so renaming the colorway can never nudge the price beside it. Colorways are literal — they are the product's actual finishes, not surfaces of the page.

Colorway picker on a product pageMaterial or finish selectorSize and fit variant rowConfigurator preview

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

    Colorway thumbnails swap the main product shot while the chosen one stays marked.

Related patterns