Vue3 Rating

Vue3 Rating

·

2 min read

Vue Rating component is a star based selection input. It supports Vue 3 with PrimeVue 3 and Vue 2 with PrimeVue 2.

Setup

Refer to PrimeVue setup documentation for download and installation steps for your environment such as Vue CLI, Vite or browser.

Import

import Rating from 'primevue/rating';

Getting Started

Two-way value binding is defined using v-model.

<Rating v-model="val" />

Number of Stars

Number of stars to display is defined with stars property, default is 5.

<Rating v-model="val" :stars="7"/>

Cancel

A cancel icon is displayed to reset the value by default, set cancel as false to remove this option.

<Rating v-model="val" :cancel="false" />

Theming

Rating supports various themes featuring Material, Bootstrap, Fluent as well as your own custom themes via the Designer tool.

Resources

Visit the PrimeVue Rating showcase for demos and documentation.