Icons : FontAwesome and Material Design

Hiya,
I’m often finding I’d like an icon that is not included in the FontAwesome set “FA:”
Recently being rejected from the forced depreciation of Google AppMaker, I found the icons available there under their Material Design set, to be very good.

Given that anvil seems to like and encourage the Material Design approach (I do like it myself too) is there something I’m missing in how to use the set from there?

Looking at the onscreen hints, I see I can upload them one by one, or use a URL.
image
Surely it would be ‘rude’ to point directly to an icon url at material.io, if it works at all?

I also note that the material.io website mentions they are available as a git repository.
https://github.com/google/material-design-icons
So pending licensing requirements, and anvils’ love of git also, would these be possible to also be made available? Maybe they are already?

And last question, is this really not a Q&A topic, but it should rather be a feature request?

regards
Mark Reynolds

2 Likes

I’ve moved to feature requests. For now here’s a little hack that gives you material icons for your project.

https://anvil.works/build#clone:CE224A3DGWDV5Z5O=PAKH6T3WGY6RTSO7PTZWKQBB

Screen Shot 2020-04-12 at 17.18.26

self.label_1.material_icon = 'add'
self.link_1.material_icon = 'accessibility'
self.button_1.material_icon = 'add_shopping_cart'

9 Likes

Thanks Stu!
I’m in awe of you working on an Easter Sunday, and your ability to turn a request around so quickly without any fuss or bother! Thanks so much!
regards Mark

1 Like

I am trying to add this hack to my Material 3 project but I m getting an error:
NameError: Could not find global JS function ‘add_icon’.

I have added the module, material_icons as well as the relevant code in the form. In addition, I have set the icon property in the form to “_”.

Has something changed? Did I miss something?

Here is a sample app with the issue.

I am looking to add several of the icons from Material Symbols and Icons - Google Fonts

Is the best way to download them into the app as an asset? But I didn’t see a way to set the icon property to the asset.

Thank you for your assistance!

Dave

Worth noting that the new M3 theme uses material icons. So consider moving your project to the M3 beta theme. I’ll update the clone at some point - there’s probably a better way to do it now. add_icon should be in native libraries.

1 Like

Hi everyone, I just wanted to add that if you’re facing issues with the Material icons or want a more streamlined approach, using the M3 beta theme seems like a great solution. I’ve been using it for a while now and it works really well with Material icons.

2 Likes