1.2.1 • Published 2 years ago

svelte-star-ratings v1.2.1

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

Svelte Rating

A simple star rating component for Svelte.

Svelte Rating

Usage

Install from npm

npm install svelte-star-ratings --save

Import the component

<script>
	import Rating from 'svelte-star-ratings/Rating.svelte';
	let value = 1;
</script>

<Rating
	maxRating={5}
	bind:value={value}
	on:change={(e) => console.log('Value', e.detail)}
/>
{value}

Properties

PropertyTypeDescriptionDefault
valueNumberA property that defines the current rate-1
maxRatingNumberA property that defines the maximum rate.5
modeString <"edit","read">A property that defines if rating is in read or edit mode.edit
changeFunctionA callback function called when the rate changes
1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

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