Rating
Star rating: real radios in a radiogroup when editable, static image with a text alternative when readonly.
Editable
<Rating name="quality" label="Quality" />Readonly
<Rating name="quality-readonly" label="Quality" value={4} readOnly />Props
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | - | Form field name (shared radio group name). |
label | string | - | Group label. |
max | number | 5 | Number of stars. |
value | number | 0 | Initial (editable) or displayed (readonly) rating. |
readOnly | boolean | false | Static display instead of radios. |
hint | string | - | Renders #{name}-hint. |
error | string | - | Renders #{name}-error. |
required | boolean | false | Marks the group required. |
class | string | - | Style passthrough. |
Accessibility
- Editable stars are native radios: arrow keys move, click selects, label announces "N stars".
- Readonly exposes
role="img"with a text alternative ("Rated X out of N").