Skip to main content

Rating

Inputs & Controls

Rating

Star rating input + display component.

Usage

Capture feedback scores or show aggregated ratings.

Highlights

  • Fractional display and animation
  • Custom icon + color tokens

When to use it

  • Users review content with 1-5 style ratings.
  • Inline analytics require quick scanning.

Examples​

Default​

Preview (Web)
import { Rating } from 'react-native-molecules/components/Rating';

export default function Example() {
  return <Rating count={5} />;
}
PropTypeDefaultDescription
countnumber | undefined—rating count
valuenumber | undefined—The rating value.
defaultValuenumber | undefined—The default value for the uncontrolled state
onChange((value: number) => void) | undefined—Callback function that is fired when the hover state changes.
readonlyboolean | undefined—Removes all hover effects and pointer events.
disabledboolean | undefined—If `true`, the component is disabled
iconNamestring | undefined—name of the empty icon
iconTypeIconType | undefined—the type of the empty icon
activeIconNamestring | undefined—name of the active icon
activeIconTypeIconType | undefined—type of the active icon
sizenumber | undefined—size of all the icons
colorstring | undefined—color of the empty icon
activeColorstring | undefined—color of the active icon
iconContainerStyleViewStyle | undefined—style of the icon container component
iconPropsOmit<IconProps, "ref" | "color" | "name" | "type"> | undefined—props for to pass down to all the icons
showTooltipsboolean | undefined—display tooltips
tooltipPropsTooltipProps | undefined—for configuring tooltip won't be used if showTooltips is false
Defined in react-native-molecules/components/Rating