The lightning:buttonStateful can be used to represent a button state that toggle between states just like you experience in social media. Stateful button can show different label and icon dynamically.

Below are some examples:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="buttonstate" type="Boolean" default="false"/>
<lightning:buttonStateful
labelWhenOff="Follow"
labelWhenOn="Following"
labelWhenHover="Unfollow"
iconNameWhenOff="utility:add"
iconNameWhenOn="utility:check"
iconNameWhenHover="utility:close"
state="{! v.buttonstate }"
onclick="{! c.handleClick }"
/>
</aura:component>
view raw StatefulButtonCmp hosted with ❤ by GitHub

({
handleClick : function (cmp, event, helper) {
var buttonstate = cmp.get('v.buttonstate');
cmp.set('v.buttonstate', !buttonstate);
}
})

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="buttonstate" type="Boolean" default="false"/>
<lightning:buttonStateful
state="{! v.buttonstate }"
variant="text"
labelWhenOff="Like"
labelWhenOn="Liked"
iconNameWhenOff="utility:like"
iconNameWhenOn="utility:like"
onclick="{! c.handleClick }"
/>
</aura:component>
view raw LikeButtonCmp hosted with ❤ by GitHub

({
handleClick : function (cmp, event, helper) {
var buttonstate = cmp.get('v.buttonstate');
cmp.set('v.buttonstate', !buttonstate);
}
})

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="buttonstate" type="Boolean" default="false"/>
<aura:attribute name="button1state" type="Boolean" default="false"/>
<lightning:buttonStateful
labelWhenOff="Mute"
labelWhenOn="Muted"
labelWhenHover="UnMute"
iconNameWhenOff="utility:unmuted"
iconNameWhenOn="utility:muted"
iconNameWhenHover="utility:unmuted"
state="{! v.buttonstate }"
onclick="{! c.handleClick }"
/>
</aura:component>
view raw MuteButtonCmp hosted with ❤ by GitHub

({
handleClick : function (cmp, event, helper) {
var buttonstate = cmp.get('v.buttonstate');
cmp.set('v.buttonstate', !buttonstate);
}
})

References:

https://www.lightningdesignsystem.com/components/buttons/#flavor-stateful

https://lightningdesignsystem.com/icons/#utility

https://developer.salesforce.com/docs/component-library/bundle/lightning:buttonStateful/example#lightningcomponentdemo:exampleButtonStateful

Thanks

Arun Kumar