‮Skip to content‬
uiify

Rating

‮Input for choosing a rating from a row of stars.‬

‮Browsers‬
Chrome 123+Firefox 121+Safari 17.5+
‮Tier‬
0
‮Bundle compressed‬
1.22 kB
‮Forced layout budget‬
0 ms
‮Axe budget‬
0
‮SSR compatible‬
‮Yes‬
‮Built on‬
elements/choice
‮Published contract‬
‮Test harness‬

‮Playground‬

Rating

‮Default‬

‮API‬

Rating

‮Prop‬‮Type‬‮Default‬‮Description‬
id*string—‮Id prefix for the group and for each generated radio input.‬
defaultValuenumber0‮Rating selected on first render; selection and hover preview are native radios plus CSS, so they work without JavaScript.‬
maxnumber5‮Number of rating items rendered.‬
readOnlybooleanfalse‮Shows the rating without letting the user change it.‬
disabledbooleanfalse‮Disables every radio in the rating.‬
classNamestring—‮Class applied to the rating element.‬
aria-labelstring—‮Accessible name for the rating group.‬

‮Keyboard‬

‮Key‬‮Action‬
Tab‮Move focus to/from the control‬
Enter / Space‮Activate when focused (button-like controls)‬

‮Accessibility‬

‮Uses semantic HTML where possible. Inspect rendered markup in the playground — ARIA is added only when native elements are insufficient.‬

‮Styling hooks‬

data-disabled