Rating
stable 1.8 kB<hk-rating>A radio group wearing stars. A built-in SVG star by default, or pass any icon class — and the count is arbitrary.
#stars#score#input
In the package
npm i hellskitchen-ui Import hk-rating and use it directly. 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 | '' | Icon class for each item. Empty renders the built-in SVG star. |
| 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.