---
schema_version: "1"
id: 8c02248d09696782ad4028192f9de4d3aac60df2a2af31e9796915a4308acf66
title: Button Labels
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/accessibility/accessibility-buttons.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/accessibility-buttons.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 67ddad408479633c6535d5423381eaafac55bc08f0d699cd02069f8ecd814d73
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# Button Labels

Buttons can appear with text only, an icon and text, or an icon only. To create an accessible button, use the `lightning:button` or `lightning:buttonIcon` base components and set a textual label using the `label` attribute.

**Button with text only:**

<!-- otherprops: set_clipboard -->
```nolang
<lightning:button label="Search" 
                  onclick="{!c.doSomething}"/>

```

**Button with icon and text:**

<!-- otherprops: set_clipboard -->
```nolang
<lightning:button label="Download" iconName="utility:download" 
                  onclick="{!c.doSomething}"/>
```

`lightning:button` implements the [button](https://lightningdesignsystem.com/components/buttons/) blueprint in the Salesforce Lightning Design System (SLDS) and follows its accessibility guidelines.

**Button with icon only:**

```nolang
<lightning:buttonIcon iconName="utility:settings"
                      onclick="{!c.doSomething}
                      alternativeText="Settings"/>
```

The `alternativeText` attribute provides a text label that’s hidden from view and available to assistive technology.

`lightning:buttonIcon` implements the [button icon](https://lightningdesignsystem.com/components/button-icons/) blueprint in the SLDS and follows its accessibility guidelines.

This example shows the HTML generated by `lightning:buttonIcon`:

<!-- otherprops: set_clipboard -->
```nolang
<!-- Use assistive text to hide the label visually, but show it to screen readers -->
<button>
    ::before
    <span class="slds-assistive-text">Settings</span>
</button>
```

To support tooltip on desktop, include the `title` attribute in addition to the `label` or `alternativeText` attribute. The `title` attribute can be problematic for touch-only devices, keyboard navigation, and assistive technologies. Therefore, it must be used together with `label` or `alternativeText`.

**note:** Most ARIA states and properties are supported on these base components. For more information, see the reference documentation in the [Component Library](https://developer.salesforce.com/docs/component-library/bundle/lightning-button/documentation).

Other button-based components include:

## lightning:buttonGroup

A group of buttons. This component implements the [button group](https://lightningdesignsystem.com/components/button-groups/) blueprint in the SLDS and follows its accessibility guidelines.

## lightning:buttonIconStateful

A button with an icon only that retains state. This component implements the [button icon](https://lightningdesignsystem.com/components/button-icons/) blueprint in the SLDS and follows its accessibility guidelines.

## lightning:buttonMenu

A dropdown menu with a list of actions or items. This component implements the [menu](https://lightningdesignsystem.com/components/menus/) blueprint in the SLDS and follows its accessibility guidelines.

## lightning:buttonStateful

A button that retains state. This component implements the [button](https://lightningdesignsystem.com/components/buttons/) blueprint in the SLDS and follows its accessibility guidelines.

**See Also**  


-   [Using Images and Icons](https://developer.salesforce.com/docs/platform/aura-platform/guide/accessibility-img.md)
-   [Creating a Form](https://developer.salesforce.com/docs/platform/aura-platform/slds/lightning-base-form.md)
-   [*Component Library*: lightning:button documentation](https://developer.salesforce.com/docs/component-library/bundle/lightning:button)

