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
| Name | Type | Default | Description |
|---|---|---|---|
| value | number | 0 | Current score. Two-way bindable. |
| count | number | 5 | How many icons to render. |
| half | boolean | false | Allows half-step selection. |
| icon | string | 'pi pi-star-fill' | Icon class for each item. |
| readonly | boolean | false | Display 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.