Material: md-tabs with md-icons

Created on 30 Jun 2015  路  7Comments  路  Source: angular/material

Is it possible to use md-icons within md-tabs as shown in the material design components:

https://www.google.com/design/spec/components/tabs.html#tabs-usage

components_tabs_usage_mobile7

enhancement

Most helpful comment

You can simply put a md-icon inside a md-tab-panel:

<md-tabs>
  <md-tab>
    <md-tab-label>
      <md-icon md-svg-icon="img/icons/icon.svg"></md-icon>
    </md-tab-label>
    <md-tab-body>
      Lorem
    </md-tab-body>
  </md-tab>
</md-tabs>

Example: http://codepen.io/anon/pen/bdKdwM

image

However if you want an icon + a label below you may need to customise the css to enlarge the height of the tab.

All 7 comments

You can simply put a md-icon inside a md-tab-panel:

<md-tabs>
  <md-tab>
    <md-tab-label>
      <md-icon md-svg-icon="img/icons/icon.svg"></md-icon>
    </md-tab-label>
    <md-tab-body>
      Lorem
    </md-tab-body>
  </md-tab>
</md-tabs>

Example: http://codepen.io/anon/pen/bdKdwM

image

However if you want an icon + a label below you may need to customise the css to enlarge the height of the tab.

This isn't supported out of the box right now; however, I forked the CodePen that @MattKetmo posted above and added these tweaks:

http://codepen.io/robertmesserle/pen/PqaGrm

Many thanks!

Atm md-icon inside the active tab does not change color. In my case it does not look great.

screen shot 2015-08-31 at 23 07 09

+1

+1

This issue is closed as part of our deprecation effort.
For details, see our post Spring Cleaning 2016.

Was this page helpful?
0 / 5 - 0 ratings