2.0.0 • Published 5 years ago

@sreyaj/ng-star-rating v2.0.0

Weekly downloads
37
License
MIT
Repository
-
Last release
5 years ago

SVG Based Angular Star Rating Component

Simple Rating Component for your next Angular Project. Very simple to setup and use and comes with a lot of customizations.

User Ratings Card

Features

  • Simple and Easy to Setup
  • Ease to use
  • SVG based super light
  • Material Spec Icons for Standard Feel
  • Zero Dependencies
  • Supports half-star rating
  • Supports Rating Mode and also Display only Mode

How to Use the Component

Install the package using the command:

npm i @sreyaj/ng-star-rating

Import the StarRatingModule into your module

import { StarRatingModule } from '@sreyaj/ng-star-rating';
@NgModule({
  ...
  imports: [StarRatingModule],
  ...
})
export class AppModule {}

Now you can use the component inside your application

<ngx-star-rating></ngx-star-rating>

You can now customize it with the following attributes

Eg with few options:

<ngx-star-rating [total]="5" [filledColor]="'#ff0000'"></ngx-star-rating>

Customizations

FeatureDescriptionAttributeTypeDefault
No of StarsYou can change the total rating numbertotalnumber5
Display ModeStar Rating component can be used to just display the ratingreadonlybooleanfalse
Type of StarsThe component supports filled stars and hollow stars designtypefilled or hollowhollow
Rating ColorThe color for the filled StarsfilledColorstring#3db700
Rating ColorThe color for the empty StarsemptyColorstring#e0e0e0
Rating EventRating Emitted when user clicks on the ratingratednumbernil

Feel free to open Issues and Pull Requests