About this set
Review forms with a star rating, a title, a text field and validation. Product review form asks for an overall rating, a review title, the review itself with a character count, whether you would recommend the product, and a display name. Quick rating after delivery is a short card with a required delivery rating, four What went well chips and an optional note. The stars are a native radio group in a fieldset, using the same natural-order sibling technique as the star input set. About thirty lines of vanilla JavaScript handle validation: they switch off the browser’s bubbles, check each field on submit, write the message under the field, mark it aria-invalid, move focus to the first problem and re-check a field as soon as it is corrected. A rating counts as missing while the Clear option is selected, and the review needs at least 30 characters. On success a status message thanks the user and the form resets. Without the script, the browser’s own required checks still run.
What’s included
- Required star rating inside a real form
- Error messages under each field, linked with aria-describedby
- Focus moves to the first field with a problem
- Live character count for the review
- Yes or No pills and checkbox chips
- About thirty lines of vanilla JavaScript, no library
Accessibility
Every field has a visible label and the rating group has a legend. Errors are written as text under the field, joined to it with aria-describedby and flagged with aria-invalid, and focus moves to the first problem on submit. The success message is in a role=status region so screen readers announce it. Every control shows a 3px focus outline and transitions stop under prefers-reduced-motion.
Customise it
Change --rf-on, --rf-edge, --rf-bad, --rf-good and --rf-focus on .rf for colours and --rf-size for the stars. The Bootstrap version styles .form-control and .is-invalid with the same variables; in Tailwind edit the rf colours in @theme. Error messages live in each field's data-check attribute.






