Code examples

Use semantic HTML

This section uses an aria-label to name the region.

<section aria-label="Featured coffee">
  <h2>Featured coffee</h2>
  <!-- Content goes here -->
</section>

This section uses an aria-labelledby to name the region.

<section aria-labelledby="section-heading-alpha">
  <h2 id="section-heading-alpha">Featured coffee</h2>
  <!-- Content goes here -->
</section>

When you can’t use semantic HTML

This custom region requires extra attributes.

<div role="region" aria-label="Featured coffeee">
  <h2>Featured coffee</h2>
  <!-- Content goes here -->
</div>