Loading
×Sorry to interrupt
CSS Error
Aura Component

Button

  • Represents a button element.

    Descriptor

    lightning:button

    Targets

    Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out / Visualforce, Standalone Lightning App

Example Options

Basic Buttons

Code

<aura:component> <!-- Base variant: Makes a button look like a link --> <lightning:button variant="base" label="Base" title="Base action" onclick="{! c.handleClick }"/> <!-- Neutral variant (default) --> <lightning:button label="Neutral" title="Neutral action" onclick="{! c.handleClick }"/> <!-- Brand variant: Identifies the primary action in a group of buttons --> <lightning:button variant="brand" label="Brand" title="Brand action" onclick="{! c.handleClick }" /> <!-- Brand-outline variant: Identifies the primary action in a group of buttons, but has a lighter look --> <lightning:button variant="brand-outline" label="Brand Outline" title="Brand action" onclick="{! c.handleClick }" /> <!-- Destructive variant: Identifies a potentially negative action --> <lightning:button variant="destructive" label="Destructive" title="Destructive action" onclick="{! c.handleClick }"/> <!-- Destructive-text variant: Identifies a potentially negative action, but has a lighter look --> <lightning:button variant="destructive-text" label="Destructive Text" title="Destructive action" onclick="{! c.handleClick }"/> <!-- Success variant: Identifies a successful action --> <lightning:button variant="success" label="Success" title="Success" onclick="{! c.handleClick }"/> </aura:component> 
Component
Controller
Example
Documentation
Specification