1.0.5 • Published 2 years ago

svelte-rating-svg v1.0.5

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Easy to use, run and install Svelte component for building SVG stars-rating. It can be used to make unlimited stars with fractional rating and any colors. Component compatible with Server Side Rendering (SSR).

Installation

npm install svelte-rating-svg

Usage

<script>
  import Rating from 'svelte-rating-svg'
</script>

<Rating value="0.25"/>

Properties

PropertyDescriptionTypeDefault
valueValue between 0 and 1Number0
colorColor of starsStringred
maxMaximum number of starsNumber5
durationTransition duration in millisecondsNumber1000

Examples

CodeResult
<Rating value="0.5" color="green" max="3"/>rating-0.5-3-green.svg
<Rating value="0.9" color="#AAA" duration="10000"/>rating-0.9-5-#AAA.svg
<Rating value="0.4321" max="1"/>rating-0.4321-1-red.svg
1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago