Hello!
When working on XWIKI-19450: Several nav tags are used without aria-label, I thought about the need to add a label
parameter to the Menu Macro.
The Menu Macro did already have an id
parameter, but nothing close to a human readable label. In the context of this issue, the label would be used on the navigation element generated by the menu. The main purpose of this parameter is to give an accessible name to the menu bar, a navigation element. Accessible names can typically be set as attributes aria-label
or title
.
About aria-label:
A brief description of the purpose of the navigation, omitting the term “navigation”, as the screen reader will read both the role and the contents of the label.
from mdn web docs on the navigation landmark
Defines a string value that labels the current element.
[…]
It provides the user with a recognizable name of the object.
from WAI-ARIA 1.3
As we can see above, the definition of the attribute is not always completely equal to the way it’s supposed to be used in interfaces:
- WAI-ARIA:
aria-label
content is very similar to aname
- MDN:
aria-label
content is similar to a description
I think most macros that generate some UI content could use a label
parameter to set as an accessible name for the element they generate.
I think label
is a correct way to name it, because this name is as wide as its use might be: for some macros this label will be very close to a name
, and for others it will be more similar to a short description of the functionality.
Some other names we could use for this parameter might be name
or title
.
What do you think of the name label
for such Macro Parameters ?
Do you think we should make it a recommendation and update the Parameters section of the wiki Macro tutorial?
Thank you for reading and I’m looking forward to your feedback!