Button

DesignReactAccessibility

Accessibility

Button

NameTypeDescription
titlestringAllows you to specify an aria-label attribute of the component.
ariaLabelledbystringAllows you to specify an aria-labelledby attribute of the component.
ariaControlsstringAllows you to specify an aria-controls attribute of the component.
ariaExpandedbooleanAllows you to specify an aria-expanded attribute of the component.
ariaCurrentstringAllows you to specify an aria-current attribute of the component.

Example

Example 1:

<Button title="Open modal window">Open</Button>

Example 2:

<div>
<h2 id="section-title">Section Title</h2>
<Button
title="Expand section"
ariaLabelledby="section-title"
ariaControls="section-content"
ariaExpanded={true}
ariaCurrent="true"
>
Expand
</Button>
<div id="section-content">
<p>This is the content of the section.</p>
</div>
</div>