vue-rate is a lightweight and customizable rating component for Vue.js applications. The current stable version is v3.1.0, which supports Vue 3. It provides features like customizable length, initial value, read-only mode, and the ability to define custom icons via slots or `iconref` property. Before v3.0.0, it supported Vue 2. The package has a moderate release cadence, with significant updates for Vue major version compatibility and minor feature enhancements. Key differentiators include its simplicity and direct integration into Vue projects without heavy external dependencies, allowing for both basic star ratings and highly customized visual feedback mechanisms for user input. The component also ships with TypeScript types.
npm install vue-rateVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to install and integrate `vue-rate` into a Vue 3 application, including basic usage with `v-model` and advanced customization using a custom SVG icon via the default slot.
For Vue 2 projects, install `vue-rate@^2.0.0` (e.g., `npm install vue-rate@2`). For Vue 3 projects, install `vue-rate@latest` or `vue-rate@next`.
Add `import 'vue-rate/dist/vue-rate.css'` to your application's entry point (e.g., `main.js` or `main.ts`).
Prefer using the default slot to pass in your custom SVG icon markup directly within the `<rate>` component. For example: `<rate><svg>...</svg></rate>`.
Ensure that the `v-model` bound variable or the `value` prop is a `Number` or `String`. Example: `const myRating = ref(0);` or `<rate :value="'3'">`.
Ensure you have imported the component and registered it globally: `import rate from 'vue-rate'; createApp(App).use(rate).mount('#app')` for Vue 3, or `Vue.use(rate)` for Vue 2.Verify that `vue-rate` is installed correctly and that the CSS import path is `import 'vue-rate/dist/vue-rate.css'` (since v2.4.0).
Check your `vue-rate` version. If using Vue 3, ensure `vue-rate` is v3.0.0 or higher. If using Vue 2, ensure `vue-rate` is v2.x. Reinstall with the correct version constraint (e.g., `npm install vue-rate@2` or `npm install vue-rate@latest`).
No dependency data recorded yet.