Fontsource now supports Material Symbols, a new icon set with variable font support. Material Symbols offers various icons with customizable attributes such as FILL, wght, GRAD, and opsz. This allows you to create dynamic and visually appealing icons in your web applications.
To install Material Symbols from Fontsource, follow the steps below:
1. Install Icon Set
Install the desired icon set from Fontsource using your package manager of choice. For example, if you want to use the Material Symbols Round icon set, you would install the
2. Import Icon Set
In your application’s entry file or component, import the font variation you installed. For example:
You can import individual axes or the whole set with these examples:
Please refer to the Variable Fonts guide for more information on using variable fonts.
If you do not need the variable font support, you can import the standard font variation instead:
3. Apply CSS class
To ensure proper rendering of the icons, include the following CSS class in your HTML file. You can use the same class or create different classes for each icon set:
By applying the
.material-symbols-outlinedclass to the relevant elements, you can utilize the Material Symbols Outlined font in your application.
You can learn more about styling Material Symbols here.