
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
vuejs3-star-ratings
Advanced tools
A simple, customizable component for star ratings
npm install vue3-star-ratings --save
You can use register it globally like this:
import { createApp } from "vue";
import App from "./App.vue";
import vue3StarRatings from "vue3-star-ratings";
const app = createApp(App);
app.component("vue3-star-ratings", vue3StarRatings);
then use it this in your component:
<vue3-star-ratings />
Alternatively, you can use it directly:
<!-- your-component.vue -->
<template>
<vue3-star-ratings v-model="rating" />
</template>
<script>
import { defineComponent } from "vue";
import vue3starRatings from "vue3-star-ratings";
export default defineComponent({
components: {
vue3starRatings,
},
});
</script>
<script src="https://unpkg.com/vue@3.0.0"></script>
<script src="https://unpkg.com/vue3-star-ratings/dist/vue3-star-ratings.min.js"></script>
const { createApp } = Vue;
const App = {
//Component code...
};
const app = createApp(App);
app.component("vue3StarRatings", Vue3StarRatings);
app.mount("#app");
Vue3StarRatings uses v-model to sync the rating between the components and its parent :
<vue3-star-ratings v-model="rating"/>
.
You can customize the component by taking a look at the props
table below.
Prop | Description | Type | Default |
---|---|---|---|
starSize | This is the height and width of the stars in pixels | String Or Number | 32 |
starColor | This is the color of the stars when active | String | #ff9800 |
inactiveColor | This is the color of the stars when inactive | String | #333 |
numberOfStars | This is the number of stars shown and also the totalRating rating possible | Number | 5 |
step | This is the increment or decrement when the control buttons are clicked | Number | 0.5 |
controlBg | This is the background of the control buttons | String | #2e5090 |
controlColor | This is the color of the color buttons | String | #fff |
controlSize | This is the size of the the control buttons | String Or Number | 24 |
showControl | This is the option to choose if the control buttons are being shown | Boolean | true |
disableClick | This is the option to disabled click on the stars, use in conjunction with the showControl Prop | Boolean | false |
v-model | Sync the rating between the component and its parent ('Where it is been used') |
FAQs
A simple, customizable vue3 component for star ratings
The npm package vuejs3-star-ratings receives a total of 0 weekly downloads. As such, vuejs3-star-ratings popularity was classified as not popular.
We found that vuejs3-star-ratings demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.