EEnterUI
DocsComponentsThemesDonation
Get Started
  • Component onboarding
    • Card
    • MetricCard
    • ChartCard
    • Badge
    • StatusIndicator
    • Rating
EnterUIDocsFoundationsSurfaces and IndicatorsRating
FoundationsUpdated 6 May 2026

Rating

Star-based value selector with read-only and interactive modes, keyboard support, and accessible semantics.

Rating renders a discrete star scale that can be displayed as a read-only value or used as an interactive input. Interactive ratings respond to arrow keys, Home, and End for keyboard adjustments.

#Default usage

Read-only rating

Display a captured rating without interaction.

Code
<Rating aria-label="Product rating" defaultValue={4} max={5} readOnly />

#Import

Code
import { Rating } from "@froggdesign/enter-ui-react";

#Controlled

Interactive rating

Click a star or use arrow keys to change the value.

#Accessibility

Interactive Rating uses role="slider" with aria-valuenow, aria-valuemin, and aria-valuemax. Read-only rating renders as role="img". Always provide aria-label describing what is being rated. Each star button carries a label like "3 stars" for screen readers.

#API

  • value / defaultValue: current value (0–max).
  • max: highest rating (default 5).
  • onValueChange: fires when the value changes.
  • readOnly: render as a static value display.
  • disabled: prevent interaction without the read-only role.
  • name: emit a hidden input for form submission.

#Styling

Every exported component accepts className when it renders an element. EnterUI styles use .eui-* classes and --eui-* variables mapped from FroggDesign theme tokens.

PreviousStatusIndicator
NextText

On this page

  1. Default usage
  2. Import
  3. Controlled
  4. Accessibility
  5. API
  6. Styling