ARIA Widget Roles
ARIA role: button
A control that invokes an action, rather than navigates to a resource. Prefer button; a custom button needs focus, Enter and Space activation, and an accessible name. aria-pressed is for toggle buttons. The example demonstrates a native equivalent or preferred alternative and deliberately omits redundant ARIA. Explicit roles do not implement visual presentation, interaction or focus management; verify allowed role/element combinations in ARIA in HTML. Accessibility exposure varies with browser, platform and assistive technology. Test relevant combinations; rendering is not proof of accessibility.
Formal Syntax & Structure
html syntaxhtml
role="button"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| role | token | Explicit role token button; use only where allowed. Omit when native semantics match. |
| aria-pressed | tristate | Relevant when applicable. Indicates the state of a toggle button. False is unpressed, true pressed, mixed a mixed state, and omission indicates a regular button. Keep the accessible label stable and synchronize the actual toggle behavior. Values: true, false, mixed, undefined. |
| aria-expanded | boolean or undefined | Relevant when applicable. 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. Values: true, false, undefined. |
Working Example
Example Snippethtml
<button type="button" onclick="this.nextElementSibling.textContent='Saved'">Save</button><p role="status"></p>