Skip to content

Rating

Last updated 26 Nov 2026

NbRating shows or takes a score out of a few stars: one to five by default. Read only it is an image named by its value, as input it is a radio group, and clearable lets the score go back to not rated.

Props ​

PropTypeDefaultDescription
modelValuenumber | nullnullThe rating (v-model), 1 to max. null is not rated
maxnumber5How many stars
labelstring'Rating'What is rated: the group's name, or the image's
readonlybooleanfalseAn image of the value instead of an input
disabledbooleanfalseDimmed, and out of the tab order
size'sm' | 'md' | 'lg''md'Stars at 16, 20 or 24px
clearablebooleanfalseA clear button, and Delete or Backspace, set it back to null

Events ​

EventPayloadFired when
update:modelValuevalue: number | nullA star was chosen, or cleared

Slots ​

None.

Strings ​

The names it speaks come from the string catalogue, so provideNbStrings() translates them: ratingLabel, ratingValue(value, max), ratingStars(count), ratingNotRated and ratingClear.