Forum Discussion
- Maggan WåhlinIron 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 goveCopper Contributor
thanks, that's the method i did ended up using and is way less code than other methods i saw used.
Hi Russell Gove, have you tried something like the PnP reusable controls?
There is a list view component there that should have support for icons (I have used it, but without icons). There is also a file type icon component that could be useful (to use directly or to check how it was implemented)
- russell goveCopper Contributor
Thanks, joel. that's just what i was looking for.
You're welcome. did that work for your scenario?