Aria Attributes

The Aria Attributes feature allows you to enhance accessibility by adding specific aria attributes to any block in the editor. This applies not only to Greyd Blocks, but also WordPress Core blocks and any third-party blocks. Before using it, the feature must be activated on the Features page. Once enabled, each block will display a new section in the settings sidebar called Aria Attributes.

Screenshot of the Aria Attributes section without any attributes added, explained in the paragraph before and after.

Inside this section, you can click the Add Aria Attribute button to assign an attribute to the block. A dropdown menu lets you choose from the available options:

  • aria-label
  • aria-labelledby
  • aria-describedby
  • aria-hidden

Depending on your selection, the interface adapts: for the first three options, a text field appears where you must provide a value; for aria-hidden, a simple toggle is shown. After setting the value or activating the toggle, confirm with the Add button to apply the attribute, or cancel if you want to reset the process.

Screenshot of adding an Aria Label with the input fields, as explained in the paragraph above and below.
Screenshot of adding an Aria Hidden with the toggle, as explained in the paragraph above and below.

Each attribute can only be added once per block. Once added, attributes appear in a list above the Add Aria Attribute button, showing the option and its assigned value in a text field, where it can also directly be edited. Next to each entry is a red trash icon that allows you to remove it if needed.

Screenshot of an Aria Label added to the block, as explained in the paragraph above and below.

When multiple attributes are used, it is important to note that if both aria-label and aria-labelledby are set, only the aria-labelledby attribute will be rendered on the frontend. This ensures consistent behavior according to accessibility standards.

Last updated: