Rating
Collects or shows a score on a fixed scale, usually five stars.
- Status
- ReadyBuild day 13 of 21
- Code
- In React
- Role
- Form
Usage
This demo is live, and the code below it is the same code, imports included. The component lives in src/ui of this repository and is not published to npm yet.
Pastes as editable layers. Shadows are not exported.
import { Rating, type RatingType } from "@/ui";
const type: RatingType = "star";
export default function RatingDemo() {
return <Rating type={type} score={4} value="4,5" />;
}Variants and states
Every specimen is the real component from src/ui, held in one state.
Pastes as editable layers. Shadows are not exported.
Props
- score
- 1 | 2 | 3 | 4 | 5 · default none
- Required. The number of filled icons.
- type
- "star" | "heart" | "number" · default "star"
- The look.
- value
- string · default none
- The displayed average, such as 4,5. Format it for the locale before you pass it.
- showValue
- boolean · default true
- Shows the value after the icons.
- disabled
- boolean · default false
- Muted colors.
Figma to code
Figma properties by their exact names from Naming, and the React prop that carries each one. The table covers the shared properties that bear on this component; the Figma file decides which of them its component exposes. None means there is no prop for it yet.
- 🧰 Type
- type
- star, heart, or number.
- 🎯 State
- disabled
- Default or disabled.
- 🔢 Score
- score
- 1 to 5.
- Show Value, Value
- showValue, value
- The text after the icons.
Accessibility
What the code in src/ui does today, and what it leaves to you.
Keyboard
- Not focusable and not interactive. It shows a score, it does not collect one.
Screen readers
- Read as one image named Rated 4,5 out of 5. The icons are hidden so they are not read one by one.
What you still need to do
- For a control that collects a rating, build it from a radio group. This component does not.
When to use
Reviews and short satisfaction questions.
Do and don't
Do
- Label the ends of the scale.
- Show the score as text for screen readers.
Don't
- Use a rating where a yes/no answer is enough.
- Show an average without the number of ratings.
Related
4 of 28 other molecules, same role and ready ones first.
- Amount InputAn input for money that formats the value as the user types.Ready
- ComboboxAn input that suggests matching options as the user types.Ready
- Date PickerChooses a date from a calendar or by typing.Ready
- File InputLets people choose or drop a file to upload.Ready
Status reflects the component tracker snapshot of 29 October 2026.