`vue-star-rating` is a highly customizable star rating component for Vue.js applications, offering extensive control over its appearance and behavior. It maintains separate versions to support both Vue 2.x (primarily version 1.6.x, which remains the default `npm install`) and Vue 3 (via version 2.x, installed using `npm install vue-star-rating@next`). The library features a wide array of customization options, including custom star shapes (`star-points`), rounded corners, individual star coloring, glow effects, and full support for RTL (right-to-left) layouts. It integrates seamlessly with Vue's `v-model` for bidirectional data binding and provides fine-grained control over initial rating rounding and increment steps. The project actively develops the Vue 3 compatible version, ensuring continued relevance and compatibility within the evolving Vue ecosystem.
npm install vue-star-ratingVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic usage of `vue-star-rating` with Vue 3, showcasing v-model binding for an interactive rating and a read-only display. It includes several common props like `star-size`, `increment`, `glow`, and `active-color`.
For Vue 3 projects, use `npm install vue-star-rating@next`. For Vue 2, continue with `npm install vue-star-rating` (or explicitly `vue-star-rating@1`).
Ensure the `rating` prop is always passed to the `StarRating` component. When using `v-model`, this is handled automatically.
Review your custom CSS for `vue-star-rating` and update class selectors according to the new naming conventions if you are targeting internal classes. (e.g., `.star-rating` changed to `.vue-star-rating`).
If using `glow` on versions prior to 2.1.0, always specify a `:glow-color` prop, for example: `:glow-color="'#ffd055'"`.
Upgrade to `vue-star-rating@1.6.1` or higher for Vue 2 projects if you are encountering issues with `round-start-rating` and asynchronously loaded initial ratings.
To apply different colors to each star, provide an array of color strings, e.g., `:active-color="['red', 'orange', 'yellow', 'green', 'blue']"`.
This issue was resolved in `vue-star-rating@1.5.0`. Upgrade to this version or newer for Vue 2 projects.
This specific glow issue was fixed in `vue-star-rating@2.0.3`. Upgrade to this version or newer for Vue 3 projects.
Upgrade to `vue-star-rating@1.6.1` or higher for Vue 2 projects to correctly apply `round-start-rating` with async data.
Upgrade to `vue-star-rating@1.4.0` or newer for Vue 2 projects. This version introduced specific class names (e.g., `.vue-star-rating`) to avoid clashes. Review and update any custom CSS targeting the old class names.