rating

Rating

Shows a rating as stars or dots in the brand's rating colour, with an optional score and review count, at three sizes.

Parts

PartFileDoes
RatingRating.vueShows a rating as filled and empty marks, with an optional value and review count; the brand's rating colour fills the marks.
RatingIconRatingIcon.vueShows one mark of the rating, either filled or empty.
RatingMetaRatingMeta.vueShows the numeric rating and the number of reviews behind it.

Anatomy

<Rating>
  <RatingIcon />
  <RatingMeta />
</Rating>

Styling

All of Rating’s styles live in rating.json. New to styling in Frontic UI? How styling works →

Install

Installs with it
format
npm packages
@lucide/vue
class-variance-authority
reka-ui

API reference

Rating.vue

Shows a rating as filled and empty marks, with an optional value and review count; the brand's rating colour fills the marks. Renders a <div>.

Props 8

PropTypeDefault
classClassValue—
sizeRatingSize'md'
shape'star' | 'dot''star'
rating*number—
maxnumber5
countnumber—
showValuebooleanfalse
label((score: number, max: number, count?: number | undefined) => string)`${score} out of ${max}${count ? `, ${count} ${count === 1 ? 'review' : 'reviews'}` : ''}`

Slots 1

SlotSlot props
meta{ rating: number; max: number; count: number | undefined; }

Recipe rating 1 group

Recipe rating-count 1 group

Recipe rating-meta 1 group

Recipe rating-stars 2 groups

RatingIcon.vue

RatingMeta.vue
Rating