Ask Natuna

Ask about the design system

Hi, I am Natuna.

Ask me about the design system: components, tokens, statuses, and how to use them.

Natuna can be wrong. The docs are the source of truth.

Skip to content
  • IntroductionPage
  • Ask NatunaAsk about the design systemPage
  • FoundationColor, type, number, effectPage
  • Components overviewPage
  • ThemesLight and dark modePage
  • NamingProperty and page namesPage
  • Privacy statementPage
  • Text-safe stepsFirst AA and AAA step per color rampSection
  • AccessibilityWCAG 2.2 AAA rulesSection
  • Dark modeThemesSection
  • Using it todayFigma file and React codeSection
  • Component statusDesign status and In ReactSection

Arrow keys to move, Enter to open, Esc to close.

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.

type stardefault and disabled
type heartdefault and disabled
type numberdefault and disabled

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.

4 of 28 other molecules, same role and ready ones first.

See all components

Status reflects the component tracker snapshot of 29 October 2026.