Icons Google Material Icons

Google Material Icons is a free icon set from Google Fonts that works in an unusual way: you write the plain-English name of the icon as text, and the font itself swaps that text for a picture.

What Are Google Material Icons?

Material Icons is Google's free, open-source icon set built to match the Material Design guidelines. It is distributed through Google Fonts, so it loads the same way a Google web font does - with a stylesheet link in your document's head.

Loading Material Icons

Example

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>

<span class="material-icons">star</span>
<span class="material-icons">favorite</span>
<span class="material-icons">home</span>

</body>
</html>

How the Ligature Trick Works

Bootstrap Icons and Font Awesome hide a secret character behind a CSS content rule, but Material Icons does something different: the text inside the <span> is the real, readable name of the icon, like star or favorite. The Material Icons font defines a typographic feature called a ligature that recognizes that exact word and swaps it for the icon's picture when the browser renders it.

Note: Because of the ligature trick, if the font fails to load - say, the stylesheet link breaks - visitors will literally see the word "favorite" printed on the page instead of a heart icon.

Material Symbols: the Newer, Variable Version

Google now also publishes Material Symbols, a newer variable-font version of the same icon set. Material Symbols comes in Outlined, Rounded, and Sharp styles, and its weight, fill, and grade can be fine-tuned with CSS instead of needing a separate font file for every variation.

Example

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined">
</head>
<body>

<span class="material-symbols-outlined">favorite</span>

</body>
</html>
FeatureMaterial IconsMaterial Symbols
Style variantsOne fixed styleOutlined, Rounded, Sharp
CustomizationFixed weightVariable weight, fill, and grade via CSS
Class namematerial-iconsmaterial-symbols-outlined (or -rounded / -sharp)
Note: Because both are fonts, sizing and coloring them uses font-size and color - exactly like Bootstrap Icons and Font Awesome, and exactly like ordinary paragraph text.

Exercise: Icons Google

How do you specify which icon to display when using Google's Material Icons?