Premium

React Star Rating Widget

By FrontendAtlas Editorial · Updated Nov 11, 2026

Challenge summary

It should render a row of clickable stars, allow the user to select a rating with the mouse or the arrow keys, and notify a parent component when the rating changes. React focus: build a controlled component and notify parent on change.

What you'll practice

  • Display a row of stars (e.g. 5 by default).
  • Allow the parent to control the current rating via props.
  • Display the current rating value below the stars.
  • Stars render from 1 up to the configured max (default 5).
  • Tab reaches the rating once, on the checked star, or on the first star before anything is rated.

What Premium unlocks

Premium unlocks the runnable workspace, behavioral checks, implementation walkthrough, and edge-case discussion.

Free related practice

Public interview reports: LeetCode Discuss (March 2020), LeetCode Discuss (July 2020) · Amazon frontend interview questions

Upgrade to FrontendAtlas Premium to unlock this challenge. Already upgraded? Sign in to continue.

Premium is $24 a month or $99 a year, less in many countries.