Skip to content

Rating ​

te-rating is a star rating with optional half values.

Basic ​

vue
<te-rating v-model="score" />
<te-rating v-model="score" :quantity="10" />

Half values, clearable and disabled ​

vue
<te-rating v-model="score" clearable />
<te-rating :model-value="3.5" disabled />

Custom icon and colour ​

vue
<te-rating v-model="score" icon="heart-fill" color="crimson" />

Keyboard ​

The stars are a slider: one tab stop, and the arrows set the value. The step is half a star while hasHalfValues is on, a whole one otherwise.

KeyDoes
→ ↑One step up.
← ↓One step down.
Home EndZero / the maximum.

label and clearLabel name the slider and the clear button for a screen reader; pass your own to translate them.

Props ​

PropTypeDefaultDescription
modelValuenumber0Supports v-model. Halves are allowed.
quantitynumber5How many icons.
iconstring'star-fill'Icon name, from your icon font.
iconSizeClassstring'text-xl'Classes controlling the icon size.
spacingnumber (0–5)1Gap between icons.
colorstring'gold'Any CSS colour for the filled state.
hasHalfValuesbooleantrueEnables half selections.
clearablebooleanfalseAdds an eraser that resets to 0.
disabledbooleanfalseMakes it read-only.
labelstring'Rating'Accessible name for the slider.
clearLabelstring'Clear rating'Accessible name for the eraser button.

Events ​

EventPayloadDescription
update:modelValuenumberA value was picked.