Radio
Rating Radio
NewA rating built on radios: stars with hover preview, a 0 to 10 scale, or five faces.
npx motionsnack add rating-radioCustomize
<RatingRadio />Props
22 properties
| Property | Type | Default | Description |
|---|---|---|---|
| value | number | null | - | Picked rating (controlled). null picks nothing. |
| defaultValue | number | null | 4 | Rating picked at first render (uncontrolled). |
| onChange | (value: number | null) => void | - | Called with the new rating; null when it is cleared. |
| itemSize | number | - | Deprecated, no effect: stars and faces are 24px marks on a 36px target. |
| name | string | generated | Name of the radios, sent with a form. |
| id | string | generated | Id prefix of the radios. |
| className | string | '' | Extra classes on the wrapper. |
| label | string | 'How was your experience?' | Legend above the rating. Empty hides it. |
| description | string | '' | Line under the legend. Empty hides it. |
| variant | 'stars' | 'scale' | 'emoji' | 'stars' | A row of stars, a 0-10 scale of numbered cells, or five faces. |
| count | number | 5 | Number of stars. |
| allowHalf | boolean | false | Stars can be picked in halves. |
| allowClear | boolean | false | Pressing the picked value again, or Delete / Backspace, clears the rating. |
| readOnly | boolean | false | Display only: one image of the stars, no radios. |
| labels | string | 'Poor, Fair, Good, Great, Excellent' | Words for each rating, lowest first, separated by commas. |
| lowLabel | string | 'Not likely' | Text under the low end of the scale. |
| highLabel | string | 'Very likely' | Text under the high end of the scale. |
| helperText | string | '' | Small text under the rating. Empty hides it. |
| error | string | '' | Error message. Any text colours the outlines and replaces the helper text. |
| errorColor | string | '' | Overrides the per-theme error colour. Empty uses the theme pair. |
| required | boolean | false | Marks the rating as required. |
| disabled | boolean | false | Disables the rating. |
About Rating Radio
Rating Radio asks how something went and shows the answer as it is given. Stars fill up to the pointer as it moves, the star under it pops a little, and half ratings are one switch away; the 0 to 10 scale lays out numbered cells with Not likely and Very likely under the ends, the classic recommendation question; the faces go from sad to delighted and the picked one fills and grows. A line of text under the rating names the score, such as Great (4 of 5), and is read out to screen readers. Underneath are real radios, so arrow keys move the rating exactly like a native radio group and the value posts with a form, and the component shares the library's legend, helper text, error state and soft focus outline.
What's included
- Stars, 0 to 10 scale or five faces
- Hover preview with a small pop on the star
- Optional half stars
- Live label such as Great (4 of 5)
- Native radios: arrow keys and forms
- Legend, helper text and error state
- Light and dark look
- Type
- Animated React radio component
- Library
- Components · Radio
- Stack
- Next.js, React, Tailwind CSS
- Added
- 2026-11-23
- Install
npx motionsnack add rating-radio