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.

States: Default

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

PartRecipe
Ratingrating
Ratingrating-stars
Ratingrating-meta
Ratingrating-count
RatingIconrating-icon
RatingIconrating-dot
RatingMetarating-meta
RatingMetarating-value
RatingMetarating-count

Install

Writes 4 files into components/ui/rating/. For agents, npx @frontic/ui docs rating prints this reference as markdown; the MCP server serves the same.

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

API reference

Rating 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>.

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'}` : ''}`
SlotSlot props
meta{ rating: number; max: number; count: number | undefined; }
Recipe ratingSets
base: rating 3 properties
Recipe rating-starsSets
shape: dot 1 property
shape: star 1 property
Recipe rating-metaSets
base: rating-meta 4 properties
Recipe rating-countSets
base: rating-count 3 properties

RatingIcon RatingIcon.vue

RatingMeta RatingMeta.vue

Example