04.26 · Micro-Interactions
Star Rating
Stars fill up to your pointer and pop when you choose. Best for reviews.
Click it
Point along the stars and click or tap one to choose, or press Show me.
Inside, each dashed box is the spot that picks a star: pointing previews the rating, clicking chooses it and the chosen star pops. Point along the stars, or press Show me.
Click only: nothing shows until you click; Previews and pops: the stars fill up to the pointer first, and the chosen one pops. Point along the stars, or press Show me.
Try it
Change a setting, then try it again or press Show me.
Pop size
How much the chosen star grows as it pops.
Speed
How quickly each star fills with color.
The left half of a star gives half a point.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add a star rating to [the review or feedback form]. As the pointer moves along the row, fill the stars up to the one under it so the choice shows before it is made, and bring back the chosen rating when the pointer leaves. Clicking or tapping a star chooses that rating and makes the star pop: it grows briefly, dips a little below its size and settles. On touch screens, a finger dragged along the row previews too. Make the row one control that the arrow keys can change, and show the rating as a number as well, so it never depends on color alone. If the visitor has reduced motion turned on, fill the stars without the pop. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.