1.0.2 • Published 5 years ago

@rei/cdr-rating v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

CdrRating

For the most up-to-date information, see REI Cedar documentation.

Props

nametypedefault
ratingnumber0
Sets the rating values between 0 and 5. Required.
nametypedefault
countnumber0
Displays the total number of reviews.
nametypedefault
compactbooleanfalse
Hides the word 'Reviews' if true.
nametypedefault
hrefstringn/a
Sets the rating component (icons and text) to display inline and wraps them in an anchor tag.
nametypedefault
sizestring'medium'
Modifies the style variant for this component. Possible values: { ‘small’‘medium’‘large’ }

Installation

Resources are available within the CdrRating package:

  • Component: @rei/cdr-rating
  • Component styles: cdr-rating.css

To incorporate the required assets for a component, use the following steps:

1. Install using NPM

Install the CdrRating package using npm in your terminal:

Terminal

npm i @rei/cdr-rating

2. Import dependencies

main.js

// import your required CSS.
import "@rei/cdr-rating/dist/cdr-rating.css";

3. Add component to a template

local.vue

<template>
  ...
     <cdr-rating rating="4.2" count="77" />
  ...
</template>

<script>
import { CdrRating } from '@rei/cdr-rating;
export default {
  ...
  components: {
     CdrRating  
  }
}
</script>

Usage

By default the CdrRating component renders the icons in medium size (24px) with the total number of reviews.

Rating Values

  • The count for reviews will always be visible
  • Ratings are rounded to the nearest .25 because icons are represented in 25% increments
  • Screen reader text is provided which reads, “Rated rounded out of 5 with count reviews”
1.0.2

5 years ago

1.0.2-alpha.0

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago

1.0.0-alpha.4

6 years ago

1.0.0-alpha.3

6 years ago

1.0.0-alpha.2

6 years ago

1.0.0-alpha.1

6 years ago

1.0.0-alpha.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago