ARIA States & Properties

aria-expanded

Reports whether content controlled or owned by an element is expanded or collapsed. Use on the actual controlling widget; omit when it has no expandable content. It does not show or hide content automatically. Value type: boolean or undefined. Accepted values: true, false, undefined. Default or omitted behavior: undefined unless role specifies otherwise. Applicable context: button, combobox, treeitem and other supported roles. Use only where allowed for the element’s implicit or explicit role. ARIA describes accessibility semantics; it does not automatically implement the associated behavior. Test with the relevant browser and assistive technology.

Formal Syntax & Structure

html syntaxhtml
aria-expanded="false"

Parameters & Attributes

NameTypeDescription
aria-expandedboolean or undefinedAccepted values: true, false, undefined. Default or omitted behavior: undefined unless role specifies otherwise. Context: button, combobox, treeitem and other supported roles. Requiredness depends on the role.

Working Example

Example Snippethtml
<button aria-expanded="false" aria-controls="extra" onclick="const e=document.getElementById('extra');e.hidden=!e.hidden;this.setAttribute('aria-expanded',String(!e.hidden))">More</button><p id="extra" hidden>Extra information</p>
HTML Reference