Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get Angular Material Icon to show the outline in my Angular app?

I currently have

<mat-icon>info<mat-icon> 

which gives the output of the info icon with the color filled. However, I just want the outline of the icon. How do I do that?

The icon I want is https://material.io/tools/icons/?icon=info&style=outline instead of https://material.io/tools/icons/?icon=info&style=baseline

like image 968
zer0 Avatar asked May 15 '18 20:05

zer0


People also ask

Does Angular material have icons?

Icon sets allow grouping multiple icons into a single SVG file. This is done by creating a single root <svg> tag that contains multiple nested <svg> tags in its <defs> section. Each of these nested tags is identified with an id attribute. This id is used as the name of the icon.

How do I use material icons in Angular 12?

To use Material icons in Angular, use <mat-icon> component. The <mat-icon> directive supports both icon fonts and SVG icons, but not bitmap-based formats. Icons are the necessary components when building modern-day web apps, and sometimes they can be frustrating.


1 Answers

You may include this |Material+Icons+Outlinedin the url to display material icon in outline.

Example:

@import url("https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined"); 

Then in the template file, you can add in material-icons-outlined

<mat-icon class="material-icons-outlined">home</mat-icon> 
like image 109
Sher Avatar answered Sep 28 '22 03:09

Sher