Rating

The Rating component displays a visual rating scale, allowing users to select or view a rating value. It supports both interactive and read-only modes.

Usage

Default


<Rating 
  value={3}
  onChange={(val) => console.log(val)} 
/>

Props

Sortable data table
PropTypeDefaultDescription
valuenumber-The current rating value (number of filled stars).
onChange(value: number) => void-Callback fired when the user selects a new rating.
maxnumber5Total number of rating icons to display.
size"xs" | "small" | "medium" | "large" | "xl"Configured DefaultControls the size of the rating icons.
interactivebooleantrueIf false, disables interaction and makes the rating read-only.
theme"primary" | "secondary" | "tertiary" | "quaternary" | "clear"Configured DefaultColor theme for the filled rating icons.
state"success" | "error" | "warning"-Visual state indicator for the rating (success, error, warning).
labelstring-Label for screen readers describing the rating input.
classNamestring-Custom class name for the rating wrapper.
data-testidstring"rating"Test ID for querying the component in tests.