Skip to main content
WCAGrules
Quick navigation

ARIA property

aria-sort

Which way a table column is currently sorted.

It says which column is driving the current order and in which direction. Ascending, descending, other, or none. Setting it does not sort anything, and the little arrow in the header is CSS.

Which roles may carry aria-sort

Value
token
Filed as
A property, which is how ARIA files it and not a rule about how often it changes.
Roles that may carry it
columnheader, rowheader

Those lists are not advice. Browsers are required to ignore a non-global attribute sitting on a role that does not support it, so aria-sort on the wrong element is not weak, it is absent. You can read it in the DOM and nobody using a screen reader can.

Every role above comes from the specification's own list for this attribute, checked name for name. The normative definition stays with the W3C, in the aria-sort section of the ARIA specification.

Keeping aria-sort true

This is a state in everything but name and it is filed as a property, which is a fair reminder that the label tells you nothing about how often an attribute has to change. Sorting by a new column means clearing it from the old header and setting it on the new one, and the spec asks that only one header carries it at a time. Leave the old one behind and the table now claims two sort orders at once. The default is none, so a header nobody has sorted by does not need the attribute at all.

How aria-sort gets checked

There are test rules that check an ARIA attribute is one that exists, is allowed on the role underneath it, and carries a value of the right type. What they map to is ARIA's own author requirements rather than any WCAG criterion, so a misplaced attribute breaks ARIA without being a WCAG failure by itself. It becomes one under 4.1.2 Name, Role, Value the moment the missing or wrong value means the control's state cannot be worked out programmatically, which is what usually happens next.

Nothing automated catches the failure this page is about. A stale value is a valid value, on a permitted role, with the right type. It is only wrong about the world.

Attributes you will meet alongside aria-sort

  • aria-expanded Whether the thing this control opens is currently open.

Every ARIA state and property · Every ARIA role · ARIA explained

Go somewhere useful

Find tools, resources and your workspace.

29 destinations