Forum Discussion
Russell Gove
Nov 16, 2017Iron Contributor
Usinig Office UI Fabrc document icons in an SPFX webpart
Hi, How do I use Office UI Fabric document icons in an SPFX webpart. I'm showing a list of documents and I want to display the appropriate document type icon. The icons are documented at https://dev...
Maggan Wåhlin
Nov 17, 2017Iron Contributor
Could you be more specific? If you want a code example, I need to know how you fetch the document and render the HTML? Which library are you using (React, Knockout, none)?
Using the icon is quite easy:
- For each document, check the extension of the document
- If, for example, the document extension is .docx, render the appropriate HTML:
<div class="ms-BrandIcon--icon96 ms-BrandIcon--word"></div>
russell gove
Nov 25, 2017Copper Contributor
thanks, that's the method i did ended up using and is way less code than other methods i saw used.