Skip to main content
WCAGrules
Quick navigation

ARIA property

aria-setsize

How many items the set really holds, when only some are in the markup. Together with aria-posinset this is what makes an infinite list announce as 5 of 200.

It gives the total, so the position in aria-posinset has something to be a fraction of. Change what is on screen and this does not move, because it describes the set rather than the view.

Which roles may carry aria-setsize

Value
integer
Filed as
A property, which is how ARIA files it and not a rule about how often it changes.
Roles that may carry it
article, listitem, menuitem, option, radio, row, tab
Roles that inherit it
menuitemcheckbox, menuitemradio, treeitem

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-setsize 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-setsize section of the ARIA specification.

Keeping aria-setsize true

The total goes stale every time the set does, so filtering, searching and loading more all have to write it again. Where the total really is unknown, -1 is the value the spec provides for saying exactly that, and it is a better answer than a number you made up. Every item in the set should carry the same total, which is easy to get wrong when the items come from more than one component.

How aria-setsize 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-setsize

  • aria-checked Whether a checkbox, radio or switch is on, off, or partly on.
  • aria-colindex Which column a cell is in, counting from the real table rather than what is shown.
  • aria-disabled Says a control is present but not available. Unlike the disabled attribute, it stays focusable, so people can still find out it is there.
  • aria-expanded Whether the thing this control opens is currently open.
  • aria-haspopup Says this control opens something, and what kind of thing it opens. A menu, a dialog, a listbox.
  • aria-level The depth of a heading or a tree item, counting from one.
  • aria-posinset Which position this item holds in its set, when the markup does not contain the whole set.
  • aria-rowindex Which row this is, counting from the real table.

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

Go somewhere useful

Find tools, resources and your workspace.

29 destinations