StarsRating

A 5-stars row rating component

The StarsRating component accepts a rating (number) from 0 to 5, and an optional width.

Basic implementation with the value of 4.5:



1import StarsRating from '@tempoplatform/tpds/components/stars-rating'
2
3<StarsRating rating={4.5} />

Implementation with a custom width, and value of 2.5:



1import StarsRating from '@tempoplatform/tpds/components/stars-rating'
2
3<StarsRating rating={2.5} width={80} />



Prop Name

Type

Default

Required

Description

rating

Number

null

yes

The value of the rating, from 0 to 5

width

Number

100

no

The width of the rendered component in pixels

lightOnly

Boolean

false

no

Wether to force the component to render in light mode