Understanding:
There are five different types of icons that can be used in lightning component:
- Action
- Custom
- Doctype
- Standard
- Utility
Lightning icons can be used in some of the lightning components like
- lightning:button,
- lightning:buttonIcon,
- lightning:icon.
Usage of lightning:icon :
Consider following lightning component code for the usage:
https://gist.github.com/simpluslabs/ac592bb22da3d11cfbd1cd264d6bd1be
The name of the icon is specified in the iconName attribute of the component. Along with, we can also specify the size and variant of the icon according to the requirement.
Types of sizes:
- xx-small
- x-small
- small
- medium(default)
- large
Types of variant:
- inverse
- warning
- error
The icons look as follows:
To know more about the icons refer to https://www.lightningdesignsystem.com/icons/