Rating

Rating component is a star based selection input.

Two-way value binding is defined using ngModel.

Two-way value binding is defined using ngModel.

basic-demo

Number of stars to display is defined with stars property.

number-of-stars-demo

Templating allows customizing the content where the icon instance is available as the implicit variable.

template-demo

When readonly present, value cannot be edited.

readonly-demo

When disabled is present, a visual hint is applied to indicate that the Knob cannot be interacted with.

disabled-demo
template-driven-forms-demo

Rating can also be used with reactive forms. In this case, the formControlName property is used to bind the component to a form control.

reactive-forms-demo

Screen Reader

Rating component internally uses radio buttons that are only visible to screen readers. The value to read for item is retrieved from the locale API via star and stars of the aria property.

Keyboard Support

Keyboard interaction is derived from the native browser handling of radio buttons in a group.

KeyFunction
tabMoves focus to the star representing the value, if there is none then first star receives the focus.
left arrowup arrowMoves focus to the previous star, if there is none then last radio button receives the focus.
right arrowdown arrowMoves focus to the next star, if there is none then first star receives the focus.
spaceIf the focused star does not represent the value, changes the value to the star value.
ON THIS PAGE
Templates
Highly customizable application templates to get started in no time with style. Designed and implemented by PrimeTek.
Learn More