Accessible Star Rating Widget with Radio Inputs (No JavaScript Library)

A 5-star rating widget built with native radio inputs, so it's keyboard accessible and works without any JavaScript library. Uses the classic flex-direction: row-reverse plus ~ sibling-selector trick to highlight stars on hover/checked in pure CSS. A small vanilla JS layer adds a live aria-live status text, a clear button, and persists the chosen rating to localStorage.




Related snippets :

OTP / Verification Code Input with Auto-Advance...


Before/After Image Comparison Slider (CSS clip-...


React via CDN, No Build Step (React.createEleme...


Countdown Timer to a Target Date (Vanilla JavaS...