AggregateRating
The AggregateRating
component displays the average rating of a product based on other shoppers' feedback and reviews. AggregateRating
supports both Unicode symbols and glyph icons from popular toolkits, such as Font Awesome.
Importโ
import { AggregateRating } from '@faststore/ui'
Usageโ
- React
- CSS
Loading...
[data-store-aggregate-rating] {
display: flex;
}
[data-store-aggregate-rating] svg[data-store-aggregate-rating-item] {
width: 1.5rem;
margin-right: 0.5rem;
}
li[data-store-aggregate-rating-item] {
color: #ffb100;
}
Customizationโ
- React
- CSS
Loading...
[data-store-aggregate-rating] {
display: flex;
}
[data-store-aggregate-rating] svg[data-store-aggregate-rating-item] {
width: 1.5rem;
margin-right: 0.5rem;
}
/* Unicode symbols */
li[data-store-aggregate-rating-item] {
color: #ff6d75;
}
/* Unicode symbols with CSS */
span[data-store-aggregate-rating-item] {
color: #ffb100;
}
[data-store-aggregate-rating] span[data-store-aggregate-rating-item="full"]:after,
[data-store-aggregate-rating] span[data-store-aggregate-rating-item="partial"]:after {
content: "โ
";
display: block;
}
[data-store-aggregate-rating] span[data-store-aggregate-rating-item="empty"]:after {
content: "โ";
display: block;
}
Rating precisionโ
AggregateRating
uses a precision of 0.5
and rounds down any float number given by the value
prop.
Loading...
Propsโ
Customizationโ
data-store-aggregate-rating
data-aggregate-rating-item=(full|partial|empty)