A simple Ionic 4 stars rating component using Angular, with an easy API and support for all methods of binding (Property and Event Binding, Template Forms and Reactive Forms).
npm install ionic-rating> A simple Ionic 4 stars rating component using Angular, with an easy API and support for all methods of binding (Property and Event Binding, Template Forms and Reactive Forms).
- Prerequisites
- Install
- Setup
- Usage
- Author
- Contributing
- Show your support
- License
The current version of the library is compatible with Ionic 4. To use it with Ionic 3, please install v1.x.x.
Using npm
``sh`
npm install --save ionic-rating
Using yarn
`sh`
yarn add ionic-rating
Once installed you need to import our module in the parent module for the component you will be using it in:
`js
import { IonicRatingModule } from 'ionic-rating';
@NgModule({
...
imports: [IonicRatingModule, ...],
...
})
export class YourModule {
}
`
Include the component on page template, like the example below:
``
size="default"
(rateChange)="onRateChange($event)">
Template Forms:
``
size="default"
(ngModelChange)="onModelChange($event)">
Reactive Forms:
``
size="default"
- rate: number [0-5]boolean
- readonly: that controls wether editing the rating is allowed or notboolean
- resettable: that controls wether the rating should reset if the same rate is selected again'small' | 'default' | 'large'
- size:
- hover: EventEmitterEventEmitter
- leave: EventEmitter
- rateChange:
```
ion-rating {
--color: gray;
--color-filled: green;
}
š¤ Rodaina Mohamed
- Github: @RodainaMohamed
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a āļø if this project helped you!
Copyright Ā© 2019 Rodaina Mohamed.
This project is MIT licensed.