Magoo Component UI logo Magoo Component UI
← Catalog

Star Rating Input

star-rating-input molecule experimental

An interactive star rating control with hover preview and full keyboard support.

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default
ThreeStars

Props

NameTypeReq
value string
max string
label string
stars array ✓

Related components

How to use

Each star button carries a 1-based data-index and its glyph's data-filled drives the fill, so the initial value renders in screenshots with no JavaScript. behavior.js previews the fill on hover and focus, commits on click, supports Arrow/Home/End keys with roving tabindex over the radiogroup, keeps aria-checked in sync, and dispatches a bubbling "rating:change" CustomEvent with { value }. The portable self-init reads no props object.

Use cases

highlight WCAG AA SEO 15 dir: both ai-generated