blob: 60804c1e72e01d5df2cecf9aab9b4d196840d150 [file] [log] [blame]
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, width=device-width"/>
<link href="//,500,700" rel="stylesheet" type="text/css">
<link href="//,500,700,400italic" rel="stylesheet" type="text/css">
<link href="//" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="www/css/material.css">
<title>Material icons guide - Google design</title>
<body class="icons-docs">
<div class="header-wrapper">
<div class="header-title">
<span class="section-title">Material icons guide</span>
<div id="page-container">
<div id="page-inner-container">
<p>An overview of material icons—where to get them and how to integrate them with your projects.</p>
<nav class="toc">
<li><a href="#what-are-material-icons">What are material icons</a></li>
<li><a href="#getting-icons">Getting icons</a></li>
<li><a href="#icon-font-for-the-web">Icon font for the web</a></li>
<li><a href="#icon-images-for-the-web">Icon images for the web</a></li>
<li><a href="#icons-for-android">Icons for Android</a></li>
<li><a href="#icons-for-ios">Icons for iOS</a></li>
<h1 id="what-are-material-icons">What are material icons</h1>
<p>Material design system icons are simple, modern, friendly, and sometimes
quirky. Each icon is created using our design guidelines to depict in simple
and minimal forms the universal concepts used commonly throughout a UI.
Ensuring readability and clarity at both large and small sizes, these icons
have been optimized for beautiful display on all common platforms and display
<p>See the full set of material design icons at the <a href="">material icons library</a>.</p>
<div class="img"><a href=""><img src="www/images/icons-library.png" alt="alt text"></a></div>
<h1 id="getting-icons">Getting icons</h1>
<p>The icons are available in several formats and are suitable for different types
of projects and platforms, for developers in their apps, and for designers in
their mockups or prototypes.</p>
<h2 id="licensing">Licensing</h2>
<p>We have made these icons available for you to incorporate them into your
products under the <a href="">Creative Common Attribution 4.0 International License (CC-BY 4.0)</a>. Feel free to remix and re-share these icons and documentation in your
products. We&#39;d love attribution in your app&#39;s <em>about</em> screen, but it&#39;s not required. The only thing we ask is that you not re-sell
the icons themselves.</p>
<h2 id="browsing-and-downloading-individual-icons">Browsing and downloading individual icons</h2>
<p>The complete set of material icons are available on the <a href="">material icon library</a>. The icons are available for download in SVG or PNGs, formats that are
suitable for web, Android, and iOS projects or for inclusion in any designer
<h2 id="downloading-everything">Downloading everything</h2>
<p>Grab the <a href="">latest stable zip archive</a> (~57MB) of all icons or the <a href="">bleeding-edge version from master.</a></p>
<h2 id="git-repository">Git Repository</h2>
<p>The material icons are available from the <a href="">git repository</a> which contains the complete set of icons including all the various formats we
are making available.</p>
<pre><code>$ git clone
</code></pre><h2 id="installing-icons-from-bower">Installing icons from bower</h2>
<p>Install the icons using the <a href="">Bower</a> package manager.</p>
<pre><code>$ bower install material-design-icons
</code></pre><h2 id="installing-icons-from-npm">Installing icons from npm</h2>
<p>Install the icons using <a href="">npm</a> package manager.</p>
<pre><code>$ npm install material-design-icons
<h1 id="icon-font-for-the-web">Icon font for the web</h1>
<p>The material icon font is the easiest way to incorporate material icons with
web projects. We have packaged all the material icons into a single font that
takes advantage of the typographic rendering capabilities of modern browsers so
that web developers can easily incorporate these icons with only a few lines of
<p>Using the font is not only the most convenient method, but it is efficient and
looks great:</p>
<li>750+ icons all from a single download.</li>
<li>Served from Google Web Font servers or can be self hosted.</li>
<li>Supported by all modern web browsers.</li>
<li>Colored, sized and positioned entirely with CSS.</li>
<li>Vector-based: Looks great at any scale, retina displays, low-dpi display
<p>The icon font contains 750+ icons and weighs in at only 40KB (woff2 format). In
comparison, a ZIP file of these in SVGs will be more than 50% larger.</p>
<h2 id="setup-method-1-using-via-google-web-fonts">Setup Method 1. Using via Google Web Fonts</h2>
<p>The easiest way to set up icon fonts for use in any web page is through <a href="">Google Web Fonts</a>. All you need to do is include a single line of HTML:</p>
<pre><code>&lt;link href=&quot;;
</code></pre><p>Similar to other Google Web Fonts, the correct CSS will be served to activate
the &#39;Material Icons&#39; font specific to the browser. An additional CSS class will
be declared called <code>.material-icons</code>. Any element that uses this class will have the correct CSS to render these
icons from the web font.</p>
<h2 id="setup-method-2-self-hosting">Setup Method 2. Self hosting</h2>
<p>For those looking to self host the web font, some additional setup is necessary.
Host the <a href="">icon font</a> in a location, for example <code></code> and add the
following CSS rule:</p>
<pre><code>@font-face {
font-family: &#39;Material Icons&#39;;
font-style: normal;
font-weight: 400;
src: url(; /* For IE6-8 */
src: local(&#39;Material Icons&#39;),
url( format(&#39;woff2&#39;),
url( format(&#39;woff&#39;),
url( format(&#39;truetype&#39;);
</code></pre><p>In addition, the CSS rules for rendering the icon will need to be declared.
These rules are normally served as part of the Google Web Font stylesheet, but
will need to be included manually in your projects when self-hosting the font:</p>
<pre><code>.material-icons {
font-family: &#39;Material Icons&#39;;
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
width: 1em;
height: 1em;
line-height: 1;
text-transform: none;
letter-spacing: normal;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: &#39;liga&#39;;
</code></pre><h2 id="using-the-icons-in-html">Using the icons in HTML</h2>
<p>It’s easy to incorporate icons into your web page. Here’s a small example:</p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons">face</i></div>
<div class="icons-code"><code>&lt;i
<p>This example uses a typographic feature called <a href="">ligatures</a>, which allows rendering of an icon glyph simply by using its textual name. The replacement is done automatically by the web browser and provides more readable code than the equivalent numeric character reference.</p>
<p>This feature is supported in most modern browsers on both desktop and mobile
<td><strong>Version supporting ligatures</strong></td>
<td>Google Chrome</td>
<td>Mozilla Firefox</td>
<td>Apple Safari</td>
<td>Microsoft IE</td>
<td>Apple MobileSafari</td>
<td>iOS 4.2</td>
<td>Android Browser</td>
<p>For browsers that do not support ligatures, fall back to specifying the icons
using numeric character references like the example below:</p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons">&#xE87C;</i></div>
<div class="icons-code"><code>&lt;i
<p>Find both the icon names and codepoints on the <a href="">material icons library</a> by selecting any icon and opening the icon font panel. A <a href="">codepoints index</a> is also available on our git repository which shows the complete set of names
and character codes.</p>
<h2 id="styling-icons-in-material-design">Styling icons in material design</h2>
<p>These icons were designed to follow the <a href="">material design guidelines</a> and they look best when using the recommended icon sizes and colors. The styles below make it easy to apply our recommended sizes, colors, and activity states.</p>
<pre><code>// Rules for sizing the icon. { font-size: 18px; } { font-size: 24px; } { font-size: 36px; } { font-size: 48px; }
// Rules for using icons as black on a light background. { color: rgba(0, 0, 0, 0.54); } { color: rgba(0, 0, 0, 0.26); }
// Rules for using icons as white on a dark background. { color: rgba(255, 255, 255, 1); } { color: rgba(255, 255, 255, 0.3); }
</code></pre><h3 id="sizing">Sizing</h3>
<p>Although the icons in the font can be scaled to any size, in accordance with <a href="">material design icons guidelines</a>, we recommend them to be shown in either 18, 24, 36 or 48px. The default being
<p>CSS rules for the standard material design sizing guidelines:</p>
<pre><code> { font-size: 18px; } { font-size: 24px; } { font-size: 36px; } { font-size: 48px; }
</code></pre><p>Material icons look best at 24px, but if an icon needs to be displayed in an
alternative size, using the above CSS rules can help:</p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-18">face</i><div
<div class="icons-code"><code>&lt;i class=&quot;material-icons
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-24">face</i><div
<div class="icons-code"><code>&lt;i class=&quot;material-icons
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-36">face</i><div
<div class="icons-code"><code>&lt;i class=&quot;material-icons
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-48">face</i><div
<div class="icons-code"><code>&lt;i class=&quot;material-icons
<h3 id="coloring">Coloring</h3>
<p>Using the icon font allows for easy styling of an icon in any color.
In accordance with <a href="">material design icon guidelines</a>, for active icons we recommend using either black at 54% opacity or white at
100% opacity when displaying these on light or dark backgrounds, respectively.
If an icon is disabled or inactive, using black at 26% or white at 30% for
light and dark backgrounds, respectively.</p>
<p>Here are some examples, using the material CSS styles described above:</p>
<pre><code> { color: rgba(0, 0, 0, 0.54); } { color: rgba(0, 0, 0, 0.26); } { color: rgba(255, 255, 255, 1); } { color: rgba(255, 255, 255, 0.3); }
</code></pre><p>Example for drawing an icon on a light background with a dark foreground color:</p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-dark">face</i><div
<div class="icons-code"><code>&lt;i class=&quot;material-icons
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons md-dark
md-inactive">face</i><div class="icon-caption">Disabled</div></div>
<div class="icons-code"><code>&lt;i class=&quot;material-icons
md-dark md-inactive&quot;&gt;face&lt;/i&gt;</code></div>
<p>Example for drawing an icon on a dark background with a light foreground color:</p>
<div class="icons-preview-code">
<div class="icons-preview icons-dark-bg"><i class="material-icons
md-light">face</i><div class="icon-caption">Normal</div></div>
<div class="icons-code"><code>&lt;i class=&quot;material-icons
<div class="icons-preview-code">
<div class="icons-preview icons-dark-bg"><i class="material-icons md-light
md-inactive">face</i><div class="icon-caption">Disabled</div></div>
<div class="icons-code"><code>&lt;i class=&quot;material-icons
md-light md-inactive&quot;&gt;face&lt;/i&gt;</code></div>
<p>To set a custom icon color, define a CSS rule specifying the desired color for
the font:</p>
<pre><code>.material-icons.orange600 { color: #FB8C00; }
</code></pre><p>and then use the class when referring to the icon:</p>
<div class="icons-preview-code">
<div class="icons-preview"><i class="material-icons orange600">face</i><div
<div class="icons-code"><code>&lt;i class=&quot;material-icons
<h1 id="icon-images-for-the-web">Icon images for the web</h1>
<p>Material icons are also available as regular images, both in PNG and SVG
<h2 id="svg">SVG</h2>
<p>The material icons are provided as SVGs that are suitable for web projects.
Individual icons are downloadable from the <a href="">material icons library</a>. The SVGs are also available from the material design icons <a href="">git repository</a> under the path:</p>
</code></pre><p>For example, icons for maps are in <a href="">maps/svg/production</a>:</p>
</code></pre><p>If multiple icons are in use on a web site, creating spritesheets out of the
images is recommended. For more information, refer to the documentation in the <a href="">sprites directory of the git repository</a>.</p>
<h2 id="png">PNG</h2>
<p>PNG is the most traditional way to display icons on the web. Our downloads from
the <a href="">material icons library</a> provide both single and double densities for each icon. They are referred to
as <code>1x_web</code> and <code>2x_web</code> respectively in the download. Icons are also available in the git repository
</code></pre><p>If multiple icons are in use on a web site, creating spritesheets out of the
images is recommended. For more information, refer to recommendations in the <a href="">sprites directory in the git repository</a>.</p>
<h1 id="icons-for-android">Icons for Android</h1>
<p>PNGs suitable for Android are available from the <a href="">material icons library</a>. These come in all the supported screen densities so they should look good on
any device.</p>
<p>The icons are also available in the <a href="">material design icons git repository</a> in the same combination of colors and sizes named as follows:</p>
</code></pre><p>A density-independent VectorDrawable is provided which is supported from
Android Lollipop and later:</p>
</code></pre><p>The Vector Drawable is currently only available as a black 24dp icon. This is
for compatibility with our most standard icon size. To render the icon in a
different color, use <a href="">drawable tinting available on Android Lollipop</a>.</p>
<p>When using the Vector Drawable, it may not be necessary to include the xxxhdpi
density PNG since it is unlikely a device supporting that screen density does
not support Vector Drawables.</p>
<h1 id="icons-for-ios">Icons for iOS</h1>
<p>Material icons also work well within iOS apps. In both the <a href="">material icons library</a> and <a href="">git repository</a>, these icons are packaged up in <a href="">Xcode imagesets</a> which will work easily with <a href="">Xcode Asset Catalogs</a> (xcassets). These imagesets can be added to any Xcode Asset Catalogs by
dragging them into Xcode on to the asset catalog or by copying the folder into
the xcasset folder.</p>
<div class="img"><img src="www/images/ios-imageset.png" alt="alt text"></div>
<p>The imageset contains the single, double and triple density images (1x, 2x, 3x)
so they work on all known iOS screen densities. Both black and white icons are
provided, but we recommend using <a href="">UIImage&#39;s imageWithRenderingMode</a> with <a href="">UIImageRenderingModeAlwaysTemplate</a> which will allow the image to be used as an alpha mask that can be tinted to
any possible color.</p>
<p>Objective-C example:</p>
<pre><code>UIButton *button = [[UIButton alloc] init];
UIImage *closeImage =
[[UIImage imageNamed:@&quot;ic_close&quot;]
button.tintColor = [UIColor colorWithWhite:0 alpha:0.54f];
[button setImage:closeImage forState:UIControlStateNormal];
</code></pre><p>Swift Example:</p>
<pre><code>let button = UIButton()
let closeImage = UIImage(named:&quot;ic_close&quot;)?.imageWithRenderingMode(
button.tintColor = UIColor(white:0, alpha:0.54)
button.setImage(closeImage, forState:UIControlState.Normal)
</div><!-- page-inner-container -->
</div><!-- page-container -->
<!-- footer -->
<div class="logo"><a href=""><img class="google-logo" alt="Google" src="www/images/google-logo.png"></a></div>
<div class="links right">
<a href="">About</a><span class="dot">·</span>
<a href="">Privacy &amp; Terms</a>
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
ga('create', 'UA-51798601-4', 'auto');
ga('send', 'pageview');