Button
Button
is an interactive component that allows the user to execute an action. Button comes in three distinct appearances: solid, bordered, and transparent. These styles provide greater choice and flexibility for establishing hierarchy and affordance within a UI. You can display a button with or without a text description or icon.
Also known as: Action, UI action
Note: This tab list includes overflow; tab positions may be inaccurate or change when a tab is selected
- When a button has both an icon and text, use
aria-hidden
on the icon so that screen readers don't announce its text. - When a button has an icon only and no text, pass an
aria-label
to the button that describes its purpose.
- By default, a user can't place focus on a disabled button. However in certain scenarios, it may be preferable for a disabled button to receive focus. To determine if this is necessary, you can apply the following rule of thumb: "If the user or the system can enable a disabled element, it should be focusable." For further information, view the W3C guidance on the
aria-disabled
attribute.
Key | Function |
---|---|
Tab |
|
Shift + Tab |
|
Enter / Space |
|
- When a button has both an icon and text, use
aria-hidden
on the icon so that screen readers don't announce its text. - When a button has an icon only and no text, pass an
aria-label
to the button that describes its purpose.
- By default, a user can't place focus on a disabled button. However in certain scenarios, it may be preferable for a disabled button to receive focus. To determine if this is necessary, you can apply the following rule of thumb: "If the user or the system can enable a disabled element, it should be focusable." For further information, view the W3C guidance on the
aria-disabled
attribute.
Key | Function |
---|---|
Tab |
|
Shift + Tab |
|
Enter / Space |
|
- When a button has both an icon and text, use
aria-hidden
on the icon so that screen readers don't announce its text. - When a button has an icon only and no text, pass an
aria-label
to the button that describes its purpose.
- By default, a user can't place focus on a disabled button. However in certain scenarios, it may be preferable for a disabled button to receive focus. To determine if this is necessary, you can apply the following rule of thumb: "If the user or the system can enable a disabled element, it should be focusable." For further information, view the W3C guidance on the
aria-disabled
attribute.
Key | Function |
---|---|
Tab |
|
Shift + Tab |
|
Enter / Space |
|