marko-star-rating

3.1.3 • Public • Published

marko-star-rating

star rating component in marko

Usage

Install as a dependency:

npm i marko-star-rating

Include the component css. In lasso just include the component as a dependency in your browser.json. Otherwise, reference the css file from marko-star-rating/style.css.

Set the color for both inactive and active stars:

.star-rating__icon {
    color: gray;
}
 
.star-rating__icon--active:before {
    color: purple;
}

Invoke the component from your template with a score from 0 to 5. The component will render 5 stars using the html star entity, filled in according to the score rounded to the nearest quarter.

<star-rating score=3.5 />

Example

example screenshot

/marko-star-rating/

    Package Sidebar

    Install

    npm i marko-star-rating

    Weekly Downloads

    1

    Version

    3.1.3

    License

    MIT

    Unpacked Size

    5.5 kB

    Total Files

    9

    Last publish

    Collaborators

    • yomed