You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(material icon): Support for Material Symbols聽#24845
Google just published Material Symbols, a fresher version of material icons that's also packaged within a variable font, giving us designers & developers more fine-grained control over the icons' looks 馃帹 Plus, their default icon styles look a tad more modern (-> rounded icons).
It would be great to use them in our Angular projects through one of Angular's material components.
Use Case
Simplify using Google's new Material Symbols font.
I don't know how you want to simplify, but at this time, you can do that : index.html: <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" rel="stylesheet"> your.component.ts: <mat-icon fontSet="material-symbols-outlined">breastfeeding</mat-icon>
Reacted by Vladimir Drayling, Ali Altun, Matheus Ravanello Mokwa, Alessandro Prete, APTech-Group, Steve, Pedro Castro Mellado, Md. Rifayet Azam Talukder, Adam P. Wright, Lane Maxwell and 6 more
export class AppModule {
constructor(iconRegistry: MatIconRegistry) {
iconRegistry.setDefaultFontSetClass('material-symbols-outlined');
}
}
Add this in AppModule so all mat-icons will have this class
Reacted by Alexandre GODET, Frederic Goulet, a2re, bryanmcgrane, chrisfremgen, Pedro Castro Mellado, Suguru Inatomi, gulburhan, terra-incognita, Paul H and 21 more
note - if applying @dvalley56's solution, you might run into the mat-icons not being visible when you specify the icon type as fontIcon attribute of mat-icon, like this:
causes the mat-ligature-font class to be removed from the mat-icon elements.
A safer solution might be to only replace the material-icons class with material-symbols-outlined (and keep the rest of the default font sets), like this for example:
Another way to do this besides what @mmanista-bynd suggested is doing it via Provider. This way it runs earlier and you can also save it (the provider) as a constant in a library or anywhere to be added to your app.config.ts (newer Angular versions) or anywhere where you can add providers (e.g. main.ts in newer or older Angular versions):
with this: <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,300,0,0" />
in my HTML it seems that im unable to get filled icons or symbols, only outlined.
maybe due to fill being 0?
how do you handle fill, cause SCSS doesn't help:
with this: <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,300,0,0" />
in my HTML it seems that im unable to get filled icons or symbols, only outlined. maybe due to fill being 0? how do you handle fill, cause SCSS doesn't help:
I've landed several PRs (see the linked ones above) that implement this. From 22.2 going forward all the docs refer to Material Symbols, ng-add will generate a link to Material Symbols and MatIconRegistry will attempt to detect it in order to assign the right CSS class.
@crisbeto as someone who soon has to upgrade a lot of projects from v21: is there some kind of migration that would detect Material Symbols already being used and somehow work with that? Or what do I need to keep in mind when upgrading from v21 w/ Material Symbols already in use?
It's worth noting that Material Icons is still the default, because changing it would've been a massive breaking change. However, if you have a <link> tag with Material Symbols, we have some logic here that will detect it and apply the correct class automatically.
So if you're on Material Icons, things will continue to work like before. If you want to switch to Symbols, all you need to do is change your <link> tag.
I just looked at how it's done in our projects: we define a new font-face (in our case called Material Symbols Outlined) for the Symbols and then basically do what I wrote here: #24845 (comment)
So there's no in our code, it just loads it via @font-face and CSS class styles. I assume, whenever Angular actually updates the icons to Symbols, I will probably be able to just remove the extra code I added to override Material Icons. Am I correct in that assumption?
Activity
thw0rted commentedon May 3, 2022
See also: https://developers.google.com/fonts/docs/material_symbols
wibimaster commentedon Oct 7, 2022
I don't know how you want to simplify, but at this time, you can do that :
index.html:
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" rel="stylesheet">your.component.ts:
<mat-icon fontSet="material-symbols-outlined">breastfeeding</mat-icon>dvalley56 commentedon Dec 4, 2022
Tested on angular 13
Material symbols work flawlessly
Need to add this in index.html
And
class="material-symbols-outlined"in mat-iconTip:
Add this in AppModule so all mat-icons will have this class
mmanista-bynd commentedon Apr 17, 2023
note - if applying @dvalley56's solution, you might run into the
mat-icons not being visible when you specify the icon type asfontIconattribute ofmat-icon, like this:where this:
still works fine.
causes the
mat-ligature-fontclass to be removed from themat-iconelements.A safer solution might be to only replace the
material-iconsclass withmaterial-symbols-outlined(and keep the rest of the default font sets), like this for example:which keeps the
mat-ligature-fontclass name and both usages ofmat-iconwork finemibnd commentedon Apr 26, 2023
ikeen0807 commentedon Jan 3, 2024
There now is an NPM package availabe through which you can easily use the new set of material symbols from Google.
https://www.npmjs.com/package/material-symbols
zarend commentedon Jan 4, 2024
Thank you for sharing, @ikeen0807 .
@mark-langer, does material-symbols work for your use-case?
-Zach
Panossa commentedon Mar 12, 2024
Another way to do this besides what @mmanista-bynd suggested is doing it via Provider. This way it runs earlier and you can also save it (the provider) as a constant in a library or anywhere to be added to your app.config.ts (newer Angular versions) or anywhere where you can add providers (e.g. main.ts in newer or older Angular versions):
NoamRivlin commentedon Mar 19, 2024
with this:
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,300,0,0" />in my HTML it seems that im unable to get filled icons or symbols, only outlined.
maybe due to fill being 0?
how do you handle fill, cause SCSS doesn't help:
`.material-symbols-outlined {
font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}`
Spawnrad commentedon Mar 27, 2024
Use this :
link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1"
You need to declare the range to be able to do :
font-variation-settings: "FILL" 1,
or
font-variation-settings: "FILL" 0;
14 remaining items
feat(material/icon): add material symbol classes automatically (#33750)
fix(multiple): include material symbols in selectors (#33754)
docs: update documentation to use Material Symbols (#33796)
build: switch infra to material symbols
build: switch infra to material symbols (#33798)
fix(material/core): generate Material Symbols in schematic (#33797)
crisbeto commentedon Sep 14, 2026
I've landed several PRs (see the linked ones above) that implement this. From 22.2 going forward all the docs refer to Material Symbols,
ng-addwill generate a link to Material Symbols andMatIconRegistrywill attempt to detect it in order to assign the right CSS class.Panossa commentedon Sep 14, 2026
@crisbeto as someone who soon has to upgrade a lot of projects from v21: is there some kind of migration that would detect Material Symbols already being used and somehow work with that? Or what do I need to keep in mind when upgrading from v21 w/ Material Symbols already in use?
crisbeto commentedon Sep 14, 2026
It's worth noting that Material Icons is still the default, because changing it would've been a massive breaking change. However, if you have a
<link>tag with Material Symbols, we have some logic here that will detect it and apply the correct class automatically.So if you're on Material Icons, things will continue to work like before. If you want to switch to Symbols, all you need to do is change your
<link>tag.Panossa commentedon Sep 14, 2026
I just looked at how it's done in our projects: we define a new font-face (in our case called
Material Symbols Outlined) for the Symbols and then basically do what I wrote here:#24845 (comment)
So there's no in our code, it just loads it via
@font-faceand CSS class styles. I assume, whenever Angular actually updates the icons to Symbols, I will probably be able to just remove the extra code I added to override Material Icons. Am I correct in that assumption?crisbeto commentedon Sep 15, 2026
Yes, you should be able to drop that JS code from your app since it happens automatically.
angular-automatic-lock-bot commentedon Oct 20, 2026
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.