# ARIA Allowed Attr

> Elements must only use ARIA attributes that are allowed for their role.

Source: https://knowledge.evinced.com/web/web-validations/aria-allowed-attr

Elements must only use ARIA attributes that are allowed for their role.

WAI-ARIA defines which states and properties apply to each role. Using attributes that are not allowed for a given role creates conflicting semantics. Assistive technology users may hear misleading or contradictory announcements, which makes interfaces disorienting and hard to understand.

1.  Identify the element’s role. Prefer the implicit HTML role. Add an ARIA role only when needed.
2.  Look up the role’s allowed states and properties in the [ARIA spec](https://www.w3.org/TR/wai-aria-1.3/) or “[ARIA in HTML](https://www.w3.org/TR/html-aria/)”.
3.  Keep only attributes that the role permits. Remove or replace all others.
4.  If a needed behavior requires different attributes, switch to the correct role or HTML element.

## Pass Patterns

### Checkbox with `aria-checked`

The `checkbox` role supports `aria-checked` to expose its checked state.

```html
<div role="checkbox" aria-checked="false" tabindex="0">Subscribe</div>
```

### Toggle button with `aria-pressed`

A button exposes its toggle state with `aria-pressed`.

```html
<button aria-pressed="false">Mute</button>
```

### Tab with `aria-selected`

The `tab` role supports `aria-selected` to indicate the active tab.

```html
<div role="tab" aria-selected="true" id="t1">Overview</div>
```

### Textbox with `aria-multiline`

The `textbox` role supports `aria-multiline` to indicate it accepts multiple lines of text.

```html
<div role="textbox" aria-multiline="true" contenteditable="true"></div>
```

## Fail Patterns

### Button with `aria-checked`

The `button` role does not allow `aria-checked`. Use `aria-pressed` for toggle buttons.

```html
<button aria-checked="true">Mute</button>
```

### Checkbox with `aria-selected`

The `checkbox` role does not allow `aria-selected`.

```html
<div role="checkbox" aria-selected="true" aria-checked="true"></div>
```

### Tabpanel with `aria-checked`

The `tabpanel` role does not allow `aria-checked`.

```html
<section role="tabpanel" aria-checked="true">Content</section>
```

### Textbox with `aria-expanded`

The `textbox` role does not allow `aria-expanded` unless it is part of a combobox pattern.

```html
<div role="textbox" aria-expanded="true"></div>
```

**Edge cases:**

-   Global states and properties such as `aria-current` and `aria-describedby` are allowed on any element so long as it is not marked as presentational.
-   Some attributes are valid only in specific patterns. Example: `aria-expanded` is valid on a `row` only if that `row` is within a `treegrid`.
-   If a custom widget keeps triggering this rule, the underlying role choice is likely wrong. Revisit the design.

## ACT Rules

-   [ARIA state or property is permitted](https://www.w3.org/WAI/standards-guidelines/act/rules/5c01ea/)

## Try It Yourself

### Using a screen reader

**New to screen reader testing, or need a refresher?**  
Review this article first: [Practical guides for using screen readers](https://knowledge.evinced.com/a11y-essentials/practical-guides-for-using-screen-readers)

1.  Turn on a screen reader.
2.  Navigate to the element.
3.  Listen for the role and any announced states (such as `aria-checked`, `aria-pressed`, or `aria-selected`).
4.  Toggle or change the control and confirm announcements remain consistent.

**Expected results:** The screen reader announces the correct role and only valid states for that role.

**Actual results:** If a disallowed attribute is used, the announcement can be missing, wrong, or conflicting.

### Inspecting the browser dev-tools

1.  Open the element in the Elements panel.
2.  Review its implicit or explicit role.
3.  In the Accessibility panel, list all `aria-*` attributes on the element.
4.  Compare the attributes to the role’s allowed states and properties.
5.  Remove any disallowed attribute and recheck the Accessibility tree.

**Expected results:** The Accessibility panel shows the correct role with only permitted states and properties.

**Actual results:** If disallowed attributes are present, the panel may show unexpected or missing states, or contradictory information.

## FAQ

**How does this issue relate to 4.1.2 Name, role, value?**

SC 4.1.2 requires user interface components to expose the correct name, role, and value. Disallowed ARIA attributes can override or conflict with the intended role, which leads to incorrect states being exposed in the Accessibility tree and announced by assistive technologies.

**Why is this issue marked as Critical?**

Incorrect states and properties break core interaction for assistive technology users across browsers and platforms. Users may receive contradictory or missing feedback, cannot trust control status, and may fail tasks. Because this affects fundamental operability and understanding, it warrants a critical severity.

**Are global ARIA attributes always safe to use?**

Mostly. Global attributes such as `aria-describedby` and `aria-current` are valid on any role. There are two exceptions: naming attributes (`aria-label` and `aria-labelledby`) are prohibited on generic elements such as a plain `<div>` or `<span>` (see [aria-prohibited-attr](https://knowledge.evinced.com/web/web-validations/aria-prohibited-attr)), and adding a global attribute to an element with `role="none"` or `role="presentation"` causes browsers to ignore the presentational role (see [presentation-role-conflict](https://knowledge.evinced.com/web/web-validations/presentation-role-conflict)).

**When is aria-expanded appropriate?**

Use `aria-expanded` only when the control expands or collapses content, or in patterns that require it (such as `combobox` or a disclosure). Do not place it on roles that do not define expansion behavior.

**What if my widget needs attributes that the current role does not allow?**

Pick a role that matches the widget’s behavior, or use native HTML elements that already provide the correct semantics and permitted states. Avoid forcing attributes onto roles that do not support them.

**What is the difference between aria-allowed-attr and aria-prohibited-attr?**

*`aria-allowed-attr`* checks whether a role uses only the ARIA attributes explicitly permitted for that role.  
*`aria-prohibited-attr`* flags attributes that a role explicitly forbids.  
Both rules address misuse of ARIA, but from opposite directions:

-   `aria-allowed-attr` ensures roles only include permitted attributes.
-   `aria-prohibited-attr` ensures roles do not include attributes that the specification forbids.

An attribute can violate one rule or both, depending on how the ARIA specification defines valid and invalid mappings for the role.

## Standards and Regulations

| Standard | Success Criterion | Reference |
| --- | --- | --- |
| WCAG 2.2 | [4.1.2 Name, Role, Value](https://www.w3.org/TR/WCAG22/#name-role-value) (A) | For all user interface components, the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to assistive technologies. |
| EN 301 549 | [9.4.1.2 Name, Role, Value](https://www.etsi.org/standards/etsi-301-549) | Same as the WCAG text. |

## Personas impacted by this issue

-   [Screen Reader](https://knowledge.evinced.com/a11y-essentials/personas#screen-reader)
-   [Braille](https://knowledge.evinced.com/a11y-essentials/personas#braille)

## Learn More

-   [HTML Semantics and Accessibility](https://knowledge.evinced.com/a11y-essentials/html-semantics-and-accessibility)
-   [Relationships Between ARIA Roles and Attributes](https://knowledge.evinced.com/a11y-essentials/relationships-between-aria-roles-and-attributes)

## Related Issues

-   [aria-prohibited-attr](https://knowledge.evinced.com/web/web-validations/aria-prohibited-attr)
-   [aria-required-attr](https://knowledge.evinced.com/web/web-validations/aria-required-attr)
-   [aria-valid-attr](https://knowledge.evinced.com/web/web-validations/aria-valid-attr)
-   [aria-valid-attr-value](https://knowledge.evinced.com/web/web-validations/aria-valid-attr-value)
