Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/emrekara37/svelte-rate-it

Rate component for Svelte
https://github.com/emrekara37/svelte-rate-it

Last synced: 3 months ago
JSON representation

Rate component for Svelte

Awesome Lists containing this project

README

        

# Svelte Rate It

> Rate component for Svelte. Based on [vue-rate](https://github.com/SinanMtl/vue-rate).
Thanks [@SinanMtl](https://github.com/SinanMtl)

> [Demo](https://svelte.dev/repl/d0df2df581d9438eabdcd529be759812)

## Installation and usage

Install rate component for your project

```bash
npm install svelte-rate-it --save
```
or with yarn
```bash
yarn add svelte-rate-it
```

Import Svelte Rate into your app

```javascript
import Rate from "svelte-rate-it/Rate.svelte";

```

Use HTML template

```html

```

## Options from props

- `length {number}`: Star size

```html

```

- `value {number}`: Default value

```html

```

- `showCount {boolean}`: Shows rate number when mouseover the star.

```html

```

- `ratedesc {object}`: Rate star description array.

```html

```

- `disabled {boolean}`: Disable rate.

```html

```

- `readonly {boolean}`: Read-only rate.

```html

```

## Events

```javascript
const beforeRate = rate => {
console.log(rate);
};
const afterRate = rate => {
console.log(rate);
};
})
```

```html

```