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

NameTypeDefaultDescription
valuenumber0Current score. Two-way bindable.
countnumber5How many icons to render.
halfbooleanfalseAllows half-step selection.
iconstring''Icon class for each item. Empty renders the built-in SVG star.
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