Rating

stable 1.8 kB
<hk-rating>

A radio group wearing stars. The icon is yours — pass any icon class or template, and the count is arbitrary.

#stars#score#input

Live demo

Running in this page — interact with it.

Inputs

NameTypeDefaultDescription
valuenumber0Current score. Two-way bindable.
countnumber5How many icons to render.
halfbooleanfalseAllows half-step selection.
iconstring'pi pi-star-fill'Icon class for each item.
readonlybooleanfalseDisplay only — skips focus and pointer handling.

Outputs

  • valueChangeEventEmitter<number>

    Emits on selection.

Keyboard

  • ← / → Decrease / increase by one step
  • Home / End Jump to lowest / highest
  • 0 Clear the rating

Theming

This one adds no tokens of its own — it renders entirely from the global token layer.

Accessibility

  • Exposed as role="radiogroup" with one radio per item.
  • Announces "3 of 5" rather than a bare number.

More in Forms