I wanted to use an approach similar to what would be done when using the font awesome library and use the material icons in a text element so that I could store them in an option set as an attribute.
I came across this post which was very helpful.
General concept:
- Create option set
- Add attribute of type text called ‘icon’
- Put the name of the material icon in the attribute value
- Have a text element reference the options icon attribute
- Make sure the text has font type of Material Icon
Use this link to find the icons you want to use and then click on it and scroll to bottom on right side menu and find the icon name and copy by clicking
Unfortunately this doesn’t allow you to use text and an icon in Buttons dynamically, but we can still style a text element to look like a button.
If you want to use them for this purpose you can make your attribute icon value equal to [font=Material Icons] Icon Name ]/font]
Then you can use whatever font family for your text
UPDATE
This doesn’t work for Firefox or Brave…likely only works in Google Chrome Browser
@nick.carroll could we get the ability to set dynamically the icons? Would be awesome for all Icon libraries available now, in the editor Icon element to have an ability to use a dynamic expression for the Icon…it can be text based likely and should be so that we can save them to option sets, or add to option sets the ability to set an attribute to a type of icon.