Skip to content

Rating

Star rating input and display, with optional half-star precision and readonly mode.

Interactive

Click a star to set the rating. Hover previews the value before committing.

Tailwind v4
vue
<Rating v-model="score" />

Readonly display

Pass readonly to render a non-interactive display.

Tailwind v4
vue
<Rating :modelValue="score" :readonly="true" />

Sizes

Tailwind v4
vue
<Rating v-model="score" size="sm" />
<Rating v-model="score" size="md" />
<Rating v-model="score" size="lg" />

Custom max

Tailwind v4
vue
<Rating v-model="score" :max="10" />

Half-star precision

Set allowHalf to enable 0.5 increments. Hover over the left half of a star to preview the half value.

Tailwind v4
vue
<Rating v-model="score" :allowHalf="true" />

With count label

Compose Rating with text to show a review count alongside the stars.

4.5 (128 reviews)
Tailwind v4
vue
<div style="display:flex;align-items:center;gap:8px">
  <Rating :modelValue="score" :allowHalf="true" :readonly="true" size="sm" />
  <span>{{ score }} ({{ reviewCount }} reviews)</span>
</div>

Keyboard navigation

When interactive, the component responds to ArrowRight / ArrowUp (increase) and ArrowLeft / ArrowDown (decrease). Focus the rating group and use arrow keys.

Props

PropTypeDefaultDescription
modelValuenumberCurrent rating (use with v-model)
maxnumber5Number of stars
size'sm' | 'md' | 'lg''md'Star size (16 / 24 / 32 px)
readonlybooleanfalseDisables interaction and hover effects
allowHalfbooleanfalseEnable 0.5-increment half-star values

Events

EventPayloadDescription
update:modelValuenumberEmitted when a star is clicked

Private — Jetpack Labs internal use only