Rating
A score out of a few stars — hover to preview, click or use the arrow keys to rate.
Basic
Five stars bound with ngModel. Tab to it and use the arrow keys, or a number key.
Value: 4
Half
allowHalf: the left half of a star rates x.5 and the arrow keys move by half a star.
Value: 3.5
Clear
clearable shows a clear button while there is a rating; clearLabel adds text next to it. Delete and Backspace clear from the keyboard.
Stars
stars sets how many there are.
Icons
onIcon and offIcon use any icon — half stars still work.
Template
<ng-template txRatingOnIcon> and txRatingOffIcon draw your own marks.
Sizes
small, medium and large.
States
readonly shows a score that cannot change — for reviews; disabled dims it.
Form
Validators.required inside tx-field — the field names the rating and shows the error.
Design tokens
[dt] changes the rating tokens of one rating.