EnterUI
DocsComponentsThemesExamplesDonation
Get Started
  • Component onboarding
    • Card
    • MetricCard
    • ChartCard
    • Badge
    • StatusIndicator
    • Rating

Default usage

  1. EnterUI
  2. /Docs
  3. /Foundations
  4. /Surfaces and Indicators
  5. /Rating
Updated 15 October 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. Filled stars use the warning/amber token; empty stars retain a clear outline. Interactive ratings preview the full selection on pointer hover without committing it. Arrow keys, Home, and End adjust the value; touch interaction commits directly without hover.

#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

Hover to preview, click to select, 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" with the numeric score included in its accessible name. Interactive ratings expose the score through aria-valuetext. 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
NextTabs
On this page
  • Default usage
  • Import
  • Controlled
  • Accessibility
  • API
  • Styling