New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

svelte-stars-rating

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-stars-rating

A Highly Customizable, easy-to-use elegant stars rating component

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

svelte-stars-rating

A Highly Customizable, easy-to-use elegant stars rating component

MIT License view on npm

Demo

4.6 Star Rating

Edit Vue Template

Usage

Install via NPM npm i svelte-stars-rating

Then require in your project:

var StarRating = require('svelte-stars-rating');

or ES6 syntax:

import StarRating from 'svelte-stars-rating'

You can then use the following selector anywhere in your project:

  • To get up and running quick the package now supports rendering just the selector with default values
<star-rating></star-rating>

Basics

PropertyTypeDescriptionDefault
ratingNumberA number between 0.0-5.0 that will determine the fullness of the 5-stars rating polygons1
isIndicatorActiveBooleanA property that deteremines weather a rating indicator would show to the righttrue

Customized Styling

PropertyTypeDescriptionDefault
fullStarColorstringSet the full or partially-full star color#ffd219
emptyStarColorstringSet the empty or partially-empty star color#737373
styleStarWidthnumberSet the star width20

Implementation Example

Define your config options object in the component importing StarRating e.g

const app = new App({
  target: document.body,
  props: {
    name: "svelte-stars-rating",
    rating: 4.7,
    isIndicatorActive: false,
    style: {
      styleStarWidth: 85,
      styleEmptyStarColor: "#737373",
      styleFullStarColor: "#ffd219"
    }
  }
})

or

let style = {
   styleStarWidth: 85,
   styleEmptyStarColor: "#737373",
   styleFullStarColor: "#ffd219"
}
<star-rating rating="4.7" style={style]></star-rating>

Feedback would be much appreciated, questions, suggestions, issues are more than welcome.


If you like to support my open-source contributions and feeling generous, feel free to:

Buy Me A Coffee

Keywords

FAQs

Package last updated on 21 Nov 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc