๐ How to use Microsoft Fluent UI Icons on your website?

I am a full stack developer, YouTuber and blogger!
Search for a command to run...

I am a full stack developer, YouTuber and blogger!
This article provides a great way to install and use fluent UI icons in the web. But I could see the microsoft license agreement which states that the usage of these assets on any other products which is not a part or an extension of a microsoft service then it is subjected to copy rights violation.
Thanks for the info! I couldn't find anything more about these icons so I thought that it's normal to use them. Microsoft should have made this important to tell it to the people
Hey all ๐๐ Webhooks are a powerful tool that allow applications to communicate with each other in real-time. They are often used to send notifications or updates from one system to another without requiring manual intervention. If you know the bas...

Hey everyone! It's been a while since I wrote my last article. But here I am with another topic that might be informational to you ๐. This time I am writing about why you should avoid the onclick attribute in your HTML and JavaScript code. This ar...

โ What and Why Memoriez โ This is a very important question because it makes things clear as to why this app is needed. I built Memoriez because I honestly found it hard to write and maintain journal/diary entries daily. It's not easy to maintain a j...

Explained with a simple project

๐ Hey developers! This post is about how you can sort import statements in your JavaScript/TypeScript/React/Node etc projects easily with Prettier in VS Code when you format the code. https://www.youtube.com/watch?v=QQWgN0_gUxI What will you achieve...

I really love the icons used and provided by Microsoft in their products. And I always wish to use them in my projects. But it is pretty hard to find a way to use them. This post will help you to use them in your project!
It is pretty easy to set this up on both static and React apps.
If you want to use it in your static site, you can include Fabric UI Core's CDN in your <head> like this ๐.
<link
rel="stylesheet"
href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-core/11.0.0/css/fabric.min.css"
/>
And once you have added that, it's as easy as doing this ๐.
<i class="ms-Icon ms-Icon--Mail" aria-hidden="true"></i>

You can refer this site and use any icon you want. Just copy the name and paste it in the place of Mail.

<i class="ms-Icon ms-Icon--Settings" aria-hidden="true"></i>

There are 2 ways you can achieve this. 1st one is to include the CDN in the <head> tag in public/index.html and then use the <i> tag as we did in the static type. But I recommend the 2nd way which is better.
Install the @fluentui/react-icons package in your app using npm or yarn as per your preference.
npm i @fluentui/react-icons
## OR
yarn add @fluentui/react-icons
Once you do that you can easily import the icon components and use them in your app just like this one ๐
import { MailIcon, SettingsIcon } from '@fluentui/react-icons';
function App() {
return (
<div>
<MailIcon /> { /* Without any element */ }
<button>
<SettingsIcon /> { /* Within any element */ }
</button>
</div>
)
};
export default App;
As I said you can refer this site and copy the icon name and just append Icon after it.
Example: MailIcon, FeedbackIcon, etc.
Good luck ๐ and thanks for reading!