References

Beginner-friendly references for web development, with live, editable examples.

The HTML aria-flowto attribute

ARIA Accessibility
In short

aria-flowto points from one element to the next stop in an alternate reading order, named by id. Following it is the user's choice, and several ids are meant to appear as a choice of paths. The source order, Tab order and visible layout stay as they were.

Overview

The aria-flowto attribute names the next element, or elements, in an alternate reading order of content. Assistive technology can follow it in place of document source order, but only at the user's discretion, so source order remains the general default.

One id and several ids work differently. With one, assistive technology can go to the target at the user's request instead of following document order. With several, assistive technology should present the targets as path choices, and a path's name can come from its target.

The link sits beside the tree and doesn't reorganize it. A section with the attribute keeps its place among its siblings, and its target shows up in a separate flow-to relation, though Chrome and Firefox leave out a target that has the hidden attribute.

User agents or assistive technologies should offer the user a way to the targets. IAccessible2, UI Automation, ATK and the macOS accessibility API each have a mapping for the relation.

Syntax

<section id="intro" aria-label="Introduction" aria-flowto="part-2">
  ...
</section>
<aside>Related reading</aside>
<section id="part-2" aria-label="Part 2">...</section>

Values

Value
One or more element id values.

Example

Live example
<p style="margin:0 0 6px">Check the box, then compare what the first section names as its next stop.</p>
<section id="start" aria-label="Get the installer" aria-flowto="win">Download the installer.</section>
<aside style="margin:4px 0;color:#595959">Support is open from 9 to 5.</aside>
<section id="win" aria-label="Windows setup">On Windows, run the setup file.</section>
<section id="mac" aria-label="macOS setup">On macOS, open the disk image.</section>
<p style="margin:8px 0"><label><input id="both" type="checkbox"> Offer both setup paths</label></p>
<p id="state" role="status" style="margin:0"></p>
<script>
const start = document.getElementById('start');
const both = document.getElementById('both');
const state = document.getElementById('state');

function report() {
  const ids = start.getAttribute('aria-flowto').split(' ');
  const names = ids.map(id => document.getElementById(id).getAttribute('aria-label'));
  state.textContent = 'aria-flowto: ' + ids.join(' ') + '. Next stop named: ' + names.join(' or ') + '. Source order unchanged.';
}
both.addEventListener('change', () => {
  start.setAttribute('aria-flowto', both.checked ? 'win mac' : 'win');
  report();
});
report();
</script>

Best practices

  • Fix the source order before adding aria-flowto. Pages should be sequentially navigable, and a reading path that differs from the source order is for rare cases.
  • Name every target, with aria-label or aria-labelledby for example. A path can take its name from the target, so an unnamed target may leave its path without a label.
  • Chain the attribute across a longer detour. Each one names the next stop, so a target has to carry its own aria-flowto to lead anywhere further.
  • Don't patch the order with tabindex or the CSS order property. The first can pull Tab order away from the DOM, and the second can do the same to visual order.

Frequently asked questions

What does aria-flowto add to a page?
Nothing visible changes with aria-flowto. It adds a link that assistive technology can offer as another next stop.
Will Tab follow an aria-flowto path?
No, aria-flowto doesn't affect the Tab order. Tab keeps to DOM order with the attribute set, including on a button that names a later target.
Why does source order still matter with aria-flowto?
Source order is what users get whenever nothing acts on aria-flowto. It stays the default even when something does, because the detour is left to the user.
Does aria-flowto move elements the way aria-owns does?
No, aria-flowto keeps the tree as it is and adds an optional route. It's aria-owns that gives the target a new parent.
Which way can an aria-flowto path point?
An aria-flowto path can point backward as well as forward. Its value holds ID references to other elements in the same document, with no direction set, and Chrome and Firefox both expose a target earlier in the source.
Which elements accept aria-flowto?
As a global attribute, aria-flowto isn't tied to a role. The ARIA in HTML rules still bar aria-* attributes on some elements, such as meta, script and datalist.