I have included the font-awesome v5.12.1 library via CDN. Now, I want to get the list of icons
or icon text
to display as a select option. Is there any way to get the list of icons from the font-awesome js library as array so that I can display as dropdown.
Asked
Active
Viewed 2,385 times
3

Sagar Bahadur Tamang
- 2,670
- 2
- 24
- 41
-
@kevinSpaceyIsKeyserSöze I want all the list of the icons as array so I can show a dropdown. – Sagar Bahadur Tamang Mar 23 '20 at 10:53
-
Check your browser request copy the JSON out of the right request.Or go over their [API](https://fontawesome.com/how-to-use/with-the-api/setup/getting-started) – kevinSpaceyIsKeyserSöze Mar 23 '20 at 10:59
-
@kevinSpaceyIsKeyserSöze The list of the icons are inside the javascript library. I have searched their library, there isn't a way to get all the icons list as array. – Sagar Bahadur Tamang Mar 23 '20 at 11:17
-
You can use https://www.npmjs.com/package/font-blast to extract the icons as individual SVGs - you can then simply enumerate the filenames and if needed, load the relevant SVG. – IVO GELOV Mar 23 '20 at 14:08
1 Answers
2
I use their archive which has a file metadata/icons.json
which provides that (and other useful) info and I've then used Datatables to build something similar to their list.
I'm not sure if this file can also be taken from CDN, but you may want to try https://github.com/FortAwesome/Font-Awesome/blob/master/metadata/icons.json for the latest. (Caveat: could be different from CDN)
You may also want to check out this question and its answers which may help.

MBaas
- 7,248
- 6
- 44
- 61
-
Hey, if you need list of all the pro icons of FAv5 visit my gist https://gist.github.com/cptiwari20/0fb100e26fef5292fc2cd0024d9cd4f5 – cptiwari20 Oct 25 '21 at 15:48
-
and be sure to read this blog: https://blog.fontawesome.com/font-awesome-icon-metadata/ :) – MBaas Oct 26 '21 at 07:36