In short and in plain language
Many shops ask for a review after you buy. You give stars for it. Often this only works with a mouse.
Some people do not use a mouse. They use the keys or a program that reads out loud. They should be able to give stars, too.
The stars are then a group to choose from. With the arrow keys you go from star to star. Each star has a name, for example: 3 of 5 stars.
The stars must be easy to see. A frame shows where you are. Your choice is also shown as text.
If something is missing, the form tells you what. After you send it, you get a short message.
Christmas shopping is followed by review requests: anyone who orders in December finds an email after delivery asking them to rate the item, and lands in a form with five stars. For many customers this takes a few seconds. People who shop with a keyboard, a screen reader, voice control or strong magnification often get stuck there, and not because of the text but because of the stars: they only respond to the mouse, they have no name, and whether three or four are selected is shown by color alone. The W3C describes its own example for exactly this case, a rating input that demonstrates the radio group pattern (W3C, ARIA Authoring Practices Guide). This article shows how to build stars as an input that works with mouse, keyboard, touch and voice: with the accessible name “3 of 5 stars”, with enough contrast for outline and fill, with a visible focus indicator and with a text field and error message that make sense without looking at the screen. We only touch briefly on the average rating display on the product page, because it is a graphic, not an input.
Key takeaways
- Rating stars are a radio group: five radio buttons in a fieldset with a legend, Tab moves into the group, the arrow keys check the next or previous star (W3C, ARIA Authoring Practices Guide).
- Each star carries an accessible name such as “3 of 5 stars”, the star icons stay hidden from screen readers, and the chosen level is also shown as text next to the group (W3C, WCAG 2.2).
- Star outlines and fills need at least 3:1 contrast against their surroundings; pale yellow stars on white reach only 1.2:1 and fail (W3C, Understanding 1.4.11).
- The active star needs a visible focus ring, 2 pixels wide with at least 2 pixels of spacing in the W3C example; 67 percent of websites remove the default focus outline (Web Almanac 2025).
- If the star choice or the text is missing, a message names the field and the error in text and is linked to the field; after submitting, a status message confirms receipt (W3C, WCAG 2.2).
- Stars as links in the review email each need alt text such as “Rate 4 out of 5 stars”, otherwise the screen reader announces five links with no difference (W3C, WCAG 2.2).
Why the review form matters after the purchase
Reviews are written in a short window after delivery. Anyone who gets stuck on the form during that time usually does not review at all, and the shop loses exactly the voices it rarely hears otherwise. At the end of 2025, a little over 7.8 million people with severe disabilities lived in Germany (Destatis). On top of that come people who can only use one hand for a while, who have poor eyesight without an official certificate, or who prefer to operate their smartphone by voice. For all of them, a form that only reacts to mouse movements is a locked door.
The German Accessibility Act applies to e-commerce services provided to consumers after June 28, 2025 (Section 1 BFSG). Services are accessible when people with disabilities can find, access and use them in the usual way, without particular difficulty and in principle without outside help (Section 3 BFSG). The review section is part of the shop website where customers buy; we therefore audit it to the same extent as the product page and the checkout. To our knowledge, no court has yet ruled on whether a review form falls within the scope on its own. Microenterprises that offer or provide services are exempt (Section 3 BFSG). We summarize what the law requires in detail on our page about the BFSG requirements.
There is also a practical reason beyond the legal duty: a form that only works with a mouse distorts the picture. Someone who cannot set their stars might email customer service instead or give up. The reviews on the product page then come from a smaller group than the shop assumes, and feedback on usability and readability is the very thing that goes missing.
Three mistakes that make stars unusable
In our audits of review forms we see three mistakes particularly often, frequently all three at once. They are quick to find, because all you need is the Tab key and a screen reader:
- The stars only respond to the mouse. They are span or div elements with handlers for mouse movement and clicks and cannot be reached by keyboard. The W3C lists this case as a failure technique: when pointer-specific event handlers are the only way to a function, people without sight and users of keyboard emulators cannot use it (W3C, Technique F54). The violated criterion is 2.1.1, under which every function must be operable by keyboard (W3C, WCAG 2.2).
- The stars have no name. Five star icons without text, or with the alt text “star”, sound identical five times in a screen reader. The name and role of every control must be programmatically determinable, and so must states and values the user can set (W3C, WCAG 2.2).
- The selection is shown in color only. Three yellow and two white stars barely differ for many people. Color must not be the only visual means of conveying information (W3C, WCAG 2.2), and the selection also belongs next to the stars as text.
All three mistakes share one cause: the stars are built as a graphic with a click area instead of what they are, a choice among five values. Changing that construction fixes all three findings in one step instead of patching each one separately.
The W3C pattern: stars as a radio group
In its ARIA Authoring Practices, the W3C has published an example for stars that implements exactly this idea. A radio group there is a set of checkable buttons of which no more than one can be checked at a time (W3C, ARIA Authoring Practices Guide). That fits: a rating has exactly one value, and someone who chooses four stars is not choosing three at the same time. Filling the stars up to the chosen value is just the visual presentation of that single value.
The W3C example builds the stars from SVG graphics with ARIA roles. In shops, we prefer native radio buttons, because they bring role, state and keyboard support from the browser. The W3C itself states on the same page that the example code is not intended for production environments and advises using as much semantic HTML as possible (W3C, ARIA Authoring Practices Guide).
The radio buttons sit in a fieldset, and the question goes into the legend. The W3C describes this grouping as most important for related radio buttons and checkboxes (W3C, technique for fieldset and legend). All five inputs share the same name so the browser treats them as one group, and each has a label with the full value as text. This is the skeleton:
<fieldset class="rating">
<legend>How would you rate this item? (required)</legend>
<input type="radio" id="rating-1" name="rating" value="1" required>
<label for="rating-1">
<svg aria-hidden="true" focusable="false"><use href="#star"/></svg>
<span class="visually-hidden">1 of 5 stars</span>
</label>
<input type="radio" id="rating-2" name="rating" value="2">
<label for="rating-2">
<svg aria-hidden="true" focusable="false"><use href="#star"/></svg>
<span class="visually-hidden">2 of 5 stars</span>
</label>
<!-- stars 3 to 5 follow the same pattern -->
<p class="rating-choice">Your choice: none yet</p>
</fieldset>The star icons are hidden from screen readers with aria-hidden, and the text in the span is only visually hidden. The radio button itself may disappear visually, but not with display:none, or it is gone for the keyboard as well. A proven approach is a class that shrinks the input to a tiny area and clips it out of the visible region, while the label with the star takes over as the click area. The required attribute on the first input makes the whole group mandatory, because the browser applies it to all inputs with the same name.
| Construction | Keyboard | Name and state | Our assessment |
|---|---|---|---|
| span elements with mouse handlers | not reachable | missing | W3C failure technique, not conformant |
| Native radio buttons in a fieldset | Tab and arrow keys from the browser | from label and checked | first choice in a shop |
| ARIA radio group as in the W3C example | rebuilt in script, roving tabindex | aria-label and aria-checked | possible when the design rules out native inputs |
| Slider with aria-valuetext | arrow keys in steps | value as text | for finer scales with more steps |
Arrow keys instead of mouse movement
The W3C example defines precisely how the group behaves with the keyboard. The Tab key moves into the group, onto the checked star; if none is checked yet, focus lands on the first one (W3C, ARIA Authoring Practices Guide). The right or down arrow moves focus to the next star and checks it at the same time (W3C, ARIA Authoring Practices Guide). The left or up arrow goes back one star. At the end of the row the selection wraps around to the start, and at the start to the end. The space bar checks the focused star if it is not checked yet. A second Tab leaves the group and moves on to the text field.
Native radio buttons bring this behavior in the common browsers. One subtle difference is known: if no star is checked yet and focus arrives from behind with Shift and Tab, some browsers place it on the last star instead of the first one (W3C, ARIA Authoring Practices Guide). This is not a defect of the form, but testers should know about it so nobody reports it as a bug.
A rating starts without a preselection, because a preselected star would steer the result. The W3C notes that the state where no radio button is checked only occurs on page load (W3C, ARIA Authoring Practices Guide). Once a customer has chosen a star, the choice can be changed but no longer cleared. If the star rating is optional, the group therefore needs an additional option “no rating” or a button that resets the selection.
The arrow key selects immediately
A common trick from CSS tutorials reverses the order: in the code, the stars run from 5 to 1, and the layout flips them back with flex-direction: row-reverse so the fill can be controlled with sibling selectors. For mouse users this looks right. With the keyboard, however, the right arrow then checks the star to the left, and the screen reader reads the values backwards. When the sequence affects meaning or operation, controls must receive focus in an order that preserves meaning and operability (W3C, WCAG 2.2). The fill up to the checked star can be set with the :has() selector or by script without touching the order in the code.
Anyone building the stars as a custom component with role="radiogroup" and role="radio" has to recreate the keyboard behavior themselves. The W3C example uses a roving tabindex for this: only one star is in the Tab sequence with tabindex="0", the others carry tabindex="-1" and are therefore focusable but not part of the page Tab sequence (W3C, ARIA Authoring Practices Guide). How this technique works in detail is covered in our article on keyboard navigation with roving tabindex.
The accessible name: “3 of 5 stars”
Every star needs a name that states the full value. Under the W3C pattern, each radio button is labeled by its content, a visible label or aria-label (W3C, ARIA Authoring Practices Guide). In the W3C example, the stars are named after their count, “one star”, “two stars” and so on (W3C, ARIA Authoring Practices Guide). We write “3 of 5 stars”, because the number alone does not say how large the scale is. If the screen reader adds the position in the group, the announcement roughly reads “3 of 5 stars, radio button, checked, 3 of 5”. That is redundant, but unambiguous.
If a visible text sits next to the stars, such as “Good” under the fourth star, the accessible name must contain that text. For controls with a visible label, WCAG requires the name to contain the text that is presented visually (W3C, WCAG 2.2) and recommends placing it at the start of the name (W3C, WCAG 2.2). The name then reads “Good, 4 of 5 stars”. Someone who says “click Good” in voice control only reaches the star if “Good” is part of the name. Why controls without a fitting name are so widespread is explained in our article on empty links and buttons without a name.
Next to the group, the chosen level appears as text: “Your choice: 3 of 5 stars”. This helps everyone who has trouble seeing the fill, and people using a screen magnifier who only see part of the page. The text does not need to be a live region, because the screen reader already announces the selection when it changes; an extra announcement would read it twice. We therefore update it silently by script, and without script the selection remains recognizable through the radio buttons themselves.
The graphic does not belong in the name
Contrast and state: why yellow alone is not enough
A star is a control, and its state is information. For controls and their states, WCAG 2.2 requires a contrast ratio of at least 3:1 against adjacent colors (W3C, WCAG 2.2). The W3C Understanding document gets more specific: the visual information that indicates a state such as selected or focused also needs at least 3:1 (W3C, Understanding 1.4.11). For stars this means: the outline of an empty star must stand out from the page, and a filled star must be distinguishable from an empty one without comparing hues.
In this very document, the W3C discusses star ratings. If a 1 to 5 star scale shows the value only through hue, such as black outlines with yellow or white fill, it is likely to fail the use of color criterion (W3C, Understanding 1.4.11). Pale yellow stars on a white background, on the other hand, fail non-text contrast: yellow (#FFF000) against white reaches only 1.2:1 (W3C, Understanding 1.4.11). As passing examples, the W3C names a solid fill with contrast or a thicker dark border in addition to the yellow fill (W3C, Understanding 1.4.11).
In practice, we choose a brand color for outline and fill that reaches at least 3:1 against the page background and draw empty stars as outlines in the same color. Filled and empty then differ in shape, not just in hue. How widespread contrast problems are shows in the measurement for text: low contrast text was found on 83.9 percent of the most visited home pages (WebAIM Million 2026). How to measure and document contrast is covered in our article on color contrast in accessibility.
A third case is often forgotten: the operating system’s contrast mode. The W3C example ties the border color of the stars to the text color so that outline and focus ring keep sufficient contrast even when high contrast settings invert colors (W3C, ARIA Authoring Practices Guide). Technically, that means stroke: currentColor instead of a fixed color. How we test pages in forced colors mode is covered in our article on contrast mode with forced-colors.
Size matters too. A star is a target for fingers and mouse pointers and must be at least 24 by 24 CSS pixels, unless an exception such as sufficient spacing applies (W3C, WCAG 2.2). Small stars packed closely together often fall short of this. Because the label forms the click area, it can be enlarged with a little padding without inflating the icon.
The focus ring around the active star
Anyone rating by keyboard needs to see which star currently has focus. Every keyboard-operable interface needs a mode of operation in which the focus indicator is visible (W3C, WCAG 2.2). In the W3C example, the focus ring is 2 pixels wide and has at least 2 pixels of spacing from the star border (W3C, ARIA Authoring Practices Guide). The spacing matters, because a ring that sits directly against the filled star merges with it.
This very ring is missing surprisingly often. 67 percent of websites explicitly remove the default focus outline (Web Almanac 2025). Stars add a special twist: because the radio button is visually hidden, the browser shows focus on an invisible element. The ring therefore has to be moved to the label with CSS, for example with the selector input:focus-visible + label. The following skeleton shows hiding, outline, fill and focus:
.rating input {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.rating label {
display: inline-block;
padding: 4px; /* enlarges the click area */
}
.rating label svg {
width: 32px;
height: 32px;
stroke: currentColor; /* outline follows the text color */
fill: transparent;
}
/* one rule per value, here for three stars */
.rating:has(input[value="3"]:checked) label:nth-of-type(-n+3) svg {
fill: currentColor;
}
.rating input:focus-visible + label {
outline: 2px solid currentColor;
outline-offset: 2px;
}Focus must also not disappear behind a sticky bar. When a control receives keyboard focus, it must not be entirely hidden by content the page author has added (W3C, WCAG 2.2). Review forms often sit far down the product page, where a cookie notice or a cart bar occupies the bottom edge. How to test this is shown in our article on sticky bars under WCAG 2.4.11.
Text field and error message in the form
A rating usually comes with a text field, often also a title and a display name. Every field needs a visible label, because labels or instructions must be provided wherever content requires user input (W3C, WCAG 2.2). A placeholder in the field does not replace it, since it disappears when typing starts. How often labels are missing is shown by the annual measurement of the most visited home pages: one third of form inputs, 33.1 percent, were not properly labeled there (WebAIM Million 2026). This is how the form looks in the error state:
<fieldset class="rating" aria-describedby="rating-error">
<legend>How would you rate this item? (required)</legend>
<p id="rating-error" class="error">
Error: Please choose between 1 and 5 stars.
</p>
<!-- radio buttons as above -->
</fieldset>
<label for="review-text">Your review</label>
<p id="review-hint">What did you like or dislike?</p>
<textarea id="review-text" name="text" required
aria-describedby="review-hint review-error"
aria-invalid="true"></textarea>
<p id="review-error" class="error">
Error: Please write a short text about your rating.
</p>If an input error is automatically detected, the item in error must be identified and the error described in text (W3C, WCAG 2.2). For the review form this means: the message names the field and says what is missing, it sits right next to the field and is linked via aria-describedby. A red border alone is not enough; that would again be color as the only means. After a submission with errors, we move focus to the first field in error or to an error summary at the top of the form. Whether the message on the star group is read out when entering it depends on the screen reader. Our articles on labels and validation in forms and on error and status messages with ARIA live cover this in depth.
If the shop limits the length of the text, the field needs a counter that does not announce its status on every keystroke, and the limit is stated in the hint before typing begins. How such a counter works as a status message is shown with the personal message in our article on gift cards with a personal message and code. If the form allows photos, the file input also needs a label and a hint on format and size before a file is chosen.
After submission, the shop confirms receipt, usually with a note that the review will be checked before publication. If this message appears without a page change, it must be programmatically determinable as a status message through role or properties, so that assistive technologies can present it without receiving focus (W3C, WCAG 2.2). A container with role="status" that is already present and empty in the code when the page loads meets this requirement. If the shop loads a new page after submission, the confirmation belongs in its main heading.
The request by email: stars as links
Many review requests arrive by email and contain five stars as images, each linking to the form with a preselected value. Each of these stars is an image inside a link and needs alt text that names the destination, such as “Rate 4 out of 5 stars”. For non-text content that is a control, WCAG requires a name that describes its purpose (W3C, WCAG 2.2), and the purpose of each link must be clear from the link text or its programmatically determined context (W3C, WCAG 2.2). Without alt text, the customer hears five indistinguishable links or the image addresses.
When the customer arrives in the form through such a link, the chosen value is already set. The form shows it as a selection in the radio group and not as fixed text, so she can change it; the text “Your choice: 4 of 5 stars” makes visible what was carried over. Without a link from the email, the group starts empty. How newsletters and emails become accessible overall is covered in our article on accessible newsletters. The legal question of when such a request may be sent is not covered here; this article is only about operation.
The average belongs next to it as text
Above the form, the product page usually shows the average of all reviews. It is not an input but a graphic with a number in it, and it needs a text alternative such as “4.3 out of 5 stars, 128 reviews” (example values) as one connected text. How we implement this display is described in our article on the accessible product detail page with variants, gallery and cart. For the form, the only thing that matters is that display and input are not confused: the display is not a control, is not in the Tab sequence and has no radio role, and the input does not show the average but the customer’s own choice.
How to test the review form
A review form can be pre-checked in a few minutes. All you need is the keyboard, a screen reader and the operating system’s contrast mode; the following steps cover the points in this article:
- Keyboard only: Tab into the star group, arrow keys through all values, Tab on to the text field and the submit button; every step works without a mouse (2.1.1).
- Focus visible: with every arrow key press, a ring around the active star is visible, also on filled stars and not hidden by bars (2.4.7, 2.4.11).
- Screen reader: group name, the name of each star, role and state are announced, while the star icons themselves stay silent (4.1.2, 1.1.1).
- Contrast: outlines of empty stars, the fill of checked stars and the focus ring reach 3:1 against the background (1.4.11).
- Without color: in grayscale, checked and empty stay distinguishable, and the selection appears as text next to them (1.4.1).
- Contrast mode: in forced colors mode, outlines and focus ring remain visible.
- Error case: submit without stars and without text; the messages name the field and the error in text, and the screen reader reads them out (3.3.1).
- Order: the right arrow checks the star to the right, and the screen reader reads the values in ascending order (2.4.3).
In our WCAG audit, we document every finding with the success criterion, a screenshot, the severity and the fix. For the screen reader part, we check what the form passes on to screen readers: names, roles, states and messages. Tests with specific screen readers on specific devices are not included; what the check covers is described on our page about screen reader output. In a shop, we look at the review form together with the product page and the review email, because these three places are connected and often share the same building blocks. More on audits in retail can be found on our page about accessibility in e-commerce.
If the form is part of a custom template or an extension, we rebuild it in the existing code: the star group, error message and status message become building blocks that work the same way throughout the shop. How we approach this is described on our page about accessible web development. A good time is the quieter period after the Christmas business, so the form is ready before the next wave of review requests goes out.
Sources
Related Articles
Accessible Product Search and Filters in Online Shops
Building search, autocomplete, facet filters and results lists accessibly: the combobox pattern, WCAG 2.2 and a practical test routine for shop teams.
Accessible gift cards: purchase, personal message and code
Accessible gift cards: a design picker as a radio group, a message with a character counter, delivery date, a tagged PDF and code redemption with clear errors.
Accessible returns portal: sending items back with ease
Accessible returns portal: order lookup without retyping, the address copied from the order under WCAG 3.3.7, time limits, plus QR code and label as text.