Provides insights into user opinions for products, experiences and expert information
Shows review rating with up to 5 stars highlighted. If rating is zero, star icons are displayed using the grey outline star icon.
<div>
<cdr-rating rating="3.33333" count="100" />
<br/>
<cdr-rating rating="0" count="0" />
</div>
Creates a link to the corresponding review content if on the same page.
<div>
<p>
<cdr-rating href="https://rei.com" rating="3.33333" count="100" />
</p>
<p>
<cdr-rating href="https://rei.com" rating="0" count="0" />
</p>
</div>
Removes the word "Reviews" from the label for limited space layout.
<div>
<cdr-rating rating="3.33333" count="100" compact />
<br/>
<cdr-rating rating="0" count="0" compact />
</div>
Change size for the star icon and text. Default size is medium.
<div>
<cdr-rating size="small" rating="3.33333" count="100" compact />
<br/>
<cdr-rating size="medium" rating="3.33333" count="100" compact />
<br/>
<cdr-rating size="large" rating="3.33333" count="100" compact />
<br/>
<cdr-rating size="small" rating="0" count="0" compact />
<br/>
<cdr-rating size="medium" rating="0" count="0" compact />
<br/>
<cdr-rating size="large" rating="0" count="0" compact />
<br/>
</div>
Many WCAG requirements are contextual to their implementation. To ensure that usage of this component complies with accessibility guidelines you are responsible for the following:
href
valueThis component has compliance with WCAG guidelines by:
rating
name
number
type
0
default
Sets the rating values between 0 and 5. Required.
count
name
number
type
0
default
Displays the total number of reviews.
compact
name
boolean
type
false
default
Hides the word 'Reviews' if true.
href
name
string
type
N/A
default
Sets the rating component (icons and text) to display inline and wraps them in an anchor tag.
size
name
string
type
medium
default
Sets the rating component size; Breakpoint values are: xs, sm, md, and lg. Examples: { 'small' | 'medium' | 'large' | 'large@sm' }
By default the CdrRating component renders the icons in medium size (24px) with the total number of reviews.