I'm authoring a reusable widget, in HTML, that reflects a common pattern often seen in theatre reviews. The widget is quite simple, with minimal components, namely:
- A star rating,
- The review itself
- The reviewer (an individual/publication/website etc)
My main concern is that it's accessible to site visitors using screen readers, and so I'm wondering what the ideal mark-up would be. Currently, I'm using the following pattern:
<article>
<header>
<div aria-label="Rated n out of 5 stars">
<span aria-hidden="true">★</span>
...
<span aria-hidden="true">★</span>
</div>
<h3>Reviewer name</h3>
</header>
<p>Review contents...</p>
</article>
I'm fairly certain an article
at the root is correct, but I'd love to know if anyone has any thoughts on how to improve this.