Vibary.ai
← Vibe Coding

Rating Stars Fill

Stars light left to right under the pointer, each settling a fraction after the one before it.

feedbackfriendlyenergeticinteraction · finite · intermediate · ~0.6s
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.

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

/**
 * Vibary · Rating Stars Fill
 *
 * Stars fill left to right as the pointer sweeps across them, each one
 * settling a fraction after the one before it, and the whole row locks

About this pattern

A rating control is a preview before it is a commitment, so the row has to answer the pointer as it travels. Each star waits its turn by a few hundredths of a second, which is what makes the fill read as a run across the row rather than five things changing at once — the springs themselves are identical. The lit star is a second copy crossfaded over the resting one, because a fill cannot be tweened out of a mixed color while an opacity can and stays composited. The pointer wins while it is over the row and the locked rating is what the row falls back to when it leaves. The word underneath crossfades at one constant size and weight.

Rate a support conversationReview a delivered orderScore a help articleRate a completed booking

Where it shows up

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

  • Ridgeline
    Files
    Recent
    Shared
    Starred
    Trash
    FilesNew
    Brand refresh12 files
    Contracts6 files
    Photography48 files
    Q3 planning9 files
    Reports21 files
    Shared4 files
    Delete this project?Its 21 files and every share link stop working. This cannot be undone.
    CancelDelete
    Modal sheet

    Stars settle individually as the choice is made.

Related patterns