# KptRating (kpt-rating) A star rating on Signal Forms. Import: `import { KptRating } from '@konce-pt/angular';` ## Inputs - `value`: model; `count`: number (number of stars, default 5) - `allowHalf`: boolean - half stars, the value goes in steps of 0.5 - `readonly`/`disabled`/`required`/`invalid`/`touched`: boolean; `touch`: output - `id`/`ariaLabel`: string|null - `id` goes to the group, never the host ## Example ## Accessibility `role="radiogroup"` named by `ariaLabel` or the `kpt-form-field` label; each star is `role="radio"` with `aria-checked`, labelled from `rating.star` (`{value}`, `{max}`) - EN `1 of 5`, PL `1 z 5`. One Tab stop: `ArrowRight`/`ArrowUp` raise the score by one, `ArrowLeft`/`ArrowDown` lower it (mirrored in RTL), `Home`/`End` set the extremes, `Delete`/`Backspace` clear it; clicking the chosen star also clears it. `readonly` renders `role="img"` named "4 of 5" with no buttons, so a screen reader does not announce a row of disabled controls. `touch` fires when focus leaves the group. ## Half stars `allowHalf` splits every star into two halves, each its own `role="radio"` ("3.5 of 5" - the number follows the page language, PL "3,5 z 5"), so the group keeps the radio pattern: clicking the left half gives x.5, and the arrows step by 0.5. Read-only stars show the value rounded to a half (4.3 -> four and a half stars) while the name carries the exact score ("4.3 of 5"), so an average can be shown as it is. ## Pointer Dragging across the stars (mouse or touch) picks a score: the preview follows the pointer and releasing commits it - with `allowHalf` to the nearest half, in RTL mirrored; dragging past the first star clears the score. A short press without movement stays a click (including a second click that clears the score). Stars that light up pop in one after another - the motion follows `toggle` from `provideKptMotion` (`spring` only); `enabled: false` and the system "reduce motion" setting always win. ## Tokens Filled stars `--kpt-color-warning`; empty ones `--kpt-color-border-strong`.