Star

Rating

zyra-rating

A star-rating input for reviews and feedback forms, with hover preview and keyboard support.

API

All inputs and configuration options for zyra-rating.

PropTypeDefaultDescription
valuenumber0Current rating value
maxnumber5Number of stars to render
size'sm' | 'md' | 'lg''md'Physical size of the stars
readonlybooleanfalseDisables interaction, for display only
disabledbooleanfalseDisables interaction and dims the control

Tokens

CSS custom properties zyra-rating reads at runtime — override any of these in your own stylesheet after @use 'zyra-ng-ui'; to restyle it without touching the component itself.

TokenDefault points toDescription
Unfilled star
--zyra-color-border-strong-color
var(--zyra-color-border-strong)Color of an unfilled star.
Filled star
--zyra-color-warning-foreground
var(--zyra-color-warning)Color of a filled/hovered star.
Focus ring
--zyra-color-primary
var(--zyra-color-accent)Outline color when a star is keyboard-focused.

Accessibility

Built to meet WCAG 2.0 AA. These notes cover the key ARIA, keyboard, and interaction behaviours.

  • Container uses role="radiogroup"; each star is role="radio" with aria-checked
  • Arrow Left/Down and Right/Up adjust the value by one star