Newer Version Available

This content describes an older version of this product. View Latest

Button Labels

Buttons can appear with text only, an icon and text, or an icon without text. To create an accessible button, use lightning:button and set a textual label using the label attribute.

You can create accessible buttons using ui:button but they don’t come with Lightning Design System styling. We recommend using lightning:button instead.

Note

Button with text only:

Button with icon and text:

Button with icon only:

The alternativeText attribute provides a text label that’s hidden from view and available to assistive technology.

This example shows the HTML generated by lightning:button: