Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Accessibility
  3. ARIA
  4. ARIA reference
  5. Attributes
  6. aria-hidden

ARIA: aria-hidden attribute

Thearia-hidden state indicates whether the element is exposed to an accessibility API.

Description

Thearia-hidden attribute can be used to hide non-interactive content from the accessibility API.

Addingaria-hidden="true" to an element removes that element and all of its children from the accessibility tree. This can improve the experience for assistive technology users by hiding:

  • Purely decorative content, such as icons or images
  • Duplicated content, such as repeated text
  • Offscreen or collapsed content, such as menus

The presence of thearia-hidden attribute hides content from assistive technology but doesn't visually hide anything.

aria-hidden="true" should not be used on elements that can receive focus. Additionally, since this attribute is inherited by an element's children, it should not be added onto the parent or ancestor of a focusable element.

Warning:Do not usearia-hidden="true" on focusable elements.

An element's hidden status is based on whether it is rendered. Rendering is usually controlled by CSS. For example, an element whosedisplay property is set tonone via CSS is not rendered. An element is considered hidden if it, or any of its ancestors are not rendered or have theiraria-hidden attribute value set to true. Note that an element and its children that hasaria-hidden="true" declared on it will still be visible, unless also hidden by CSS.

Use caution when usingaria-hidden to hide visibly rendered content from assistive technologies. You should not be hiding visible content unless doing so improves the experience for users of assistive technologies by removing redundant or extraneous content. Only when identical or equivalent meaning and functionality is exposed to assistive technologies can removing visible content from the accessibility API be considered.

Note:Consider all disabilities when hiding visibly rendered content from assistive technologies. Not all users of assistive technology are visually impaired. If visible content doesn't match text content in the accessibility API, the user experience will be negatively impacted for sighted users.

On the surface, thearia-hidden="true" and therole="presentation" and its synonymrole="none" seem similar, but the intent behind each is different.

  • aria-hidden="true" will remove the entire element from the accessibility API.
  • role="presentation" androle="none" will remove the semantic meaning of an element while still exposing it and its content to assistive technology.

aria-hidden="true" should not be added when:

In all three scenarios, the attribute is unnecessary to add because the element has already been removed from the accessibility tree. Visually hiding elements withdisplay orvisibility hides content from the screen and from assistive technologies.

Usingaria-hidden="false" will not re-expose the element to assistive technology if any of its parents specifyaria-hidden="true".

Example

Addingaria-hidden="true" to the icon hides the icon character from being included in the accessible name.

html
<button>  <span aria-hidden="true"></span>  <span> Tweet </span></button>

We have a button witha Font Awesome icon. We hide the icon from assistive technologies witharia-hidden="true", as exposing the icon to assistive technologies could lead to redundancy or, if the icon doesn't have the same content as the visible text, confusion.

Values

false

The element is exposed to the accessibility API as if it was rendered.

true

The element is hidden from the accessibility API.

undefined (default)

The element's hidden state is determined by the user agent based on whether it is rendered.

Associated interfaces

Element.ariaHidden

TheariaHidden property, part of theElement interface, reflects the value of thearia-hidden attribute, which Indicates whether the element is exposed to an accessibility API.

ElementInternals.ariaHidden

TheariaHidden property, part of theElementInternals interface, reflects the value of thearia-hidden attribute

Associated roles

Used inALL roles

Specifications

Specification
Accessible Rich Internet Applications (WAI-ARIA)
# aria-hidden

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp