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

https://github.com/marinko-peso/rating-custom-element

:snowboarder: Rating Custom Element
https://github.com/marinko-peso/rating-custom-element

Last synced: about 1 month ago
JSON representation

:snowboarder: Rating Custom Element

Awesome Lists containing this project

README

        

# rating-custom-element
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)
[![license](https://img.shields.io/github/license/marinko-peso/rating-custom-element.svg)](https://github.com/marinko-peso/rating-custom-element/blob/master/LICENSE)
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg)](https://github.com/Flet/semistandard)
[![package version](https://img.shields.io/npm/v/rating-custom-element.svg)](https://npm.im/rating-custom-element)
[![install size](https://packagephobia.now.sh/badge?p=rating-custom-element)](https://packagephobia.now.sh/result?p=rating-custom-element)
[![dependecies](https://david-dm.org/marinko-peso/rating-custom-element.svg)](https://david-dm.org/marinko-peso/rating-custom-element)

:snowboarder: Rating Custom Element

Intended as plug and play HTML element to enable custom rating. Styling is left completely to the end user. For in-browser usage.

View [demo](https://htmlpreview.github.io/?https://github.com/marinko-peso/rating-custom-element/blob/master/demo/index.html).

## Installation

Available via npm:
```
npm i rating-custom-element
```

## Usage

Include ```rating-element.js``` to your html or ```import "rating-custom-element"``` if installed via npm.
Add ```x-rating-element``` html element to your dom on the place where you wish to have a rating element.
Options:
* value - initial value [default: 0]
* number - number of rating elements [default: 5]
* default-class - class name for rank elements [default: x-rating]
* marked-class - class name added to selected rank elements [default: x-marked]

## License

MIT.