function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DiamundoDiamundo 

SLDS: Icon as button

Hi there,

I am trying to create buttons, but instead of text (multiple language support) I would like to use icons.
For now: I would like these:
 - up
 - down
 - edit
 - delete

I have two questions:
 - Where can I find the icons SLDS provides? (i.e. a list of all icons)
 - How do I execute a function when someone clicks a button(icon) ?

Thanks in advance! 
Best Answer chosen by Diamundo
DiamundoDiamundo
Solved my own problem

Icons are at https://lightningdesignsystem.com/icons
Button:
<button class="slds-button" onclick="{!c.moveItemUp}">
    <lightning:icon iconName="utility:up" size="medium" alternativeText="Move this item up" />
</button>
This will execute the function 
moveItemUp : function (component, event, helper) {
    alert('Move Item Up');
}
in the controller of the component.

 

All Answers

DiamundoDiamundo
Solved my own problem

Icons are at https://lightningdesignsystem.com/icons
Button:
<button class="slds-button" onclick="{!c.moveItemUp}">
    <lightning:icon iconName="utility:up" size="medium" alternativeText="Move this item up" />
</button>
This will execute the function 
moveItemUp : function (component, event, helper) {
    alert('Move Item Up');
}
in the controller of the component.

 
This was selected as the best answer
Raj Bhatt 2151Raj Bhatt 2151
Awesome one...