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

PropTypeDefaultDescription
id*string—Id prefix for the group and for each generated radio input.
defaultValuenumber0Rating selected on first render; selection and hover preview are native radios plus CSS, so they work without JavaScript.
maxnumber5Number of rating items rendered.
readOnlybooleanfalseShows the rating without letting the user change it.
disabledbooleanfalseDisables every radio in the rating.
classNamestring—Class applied to the rating element.
aria-labelstring—Accessible name for the rating group.

Keyboard

KeyAction
TabMove focus to/from the control
Enter / SpaceActivate 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