Vue Material Design Icons

5.3.1 · active · verified Sun Apr 19

vue-material-design-icons provides a comprehensive collection of Material Design Icons encapsulated as Vue single-file components, enabling seamless integration into Vue.js projects. The library is currently stable at version 5.3.1 and maintains an active release cadence, frequently updating its icon set to mirror the upstream MaterialDesign project. A key differentiator is its packaging of each icon as an individual Vue component, allowing for granular imports and optimized bundle sizes. It supports both Vue 2 and Vue 3, with a significant breaking change in version 5.0.0 to introduce Vue 3 compatibility while ensuring continued support for Vue 2 applications. The package also offers an optional stylesheet for easier scaling and various props for customization like `fillColor` and `size`, along with important accessibility considerations for screen readers.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates how to install `vue-material-design-icons`, import individual icons as Vue components, optionally include the global stylesheet, and render multiple icons within a Vue 3 application. It showcases basic prop usage for `size`, `fillColor`, and `title`, while also indicating how to render purely decorative icons.

<!-- App.vue -->
<template>
  <div id="app">
    <h1>My Vue App with Material Icons</h1>
    <p>
      Here's a menu icon: <MenuIcon :size="32" fillColor="blue" title="Open Navigation" />
    </p>
    <p>
      And an Android icon: <AndroidIcon title="Android Application" />
    </p>
    <p>
      A larger, red home icon: <HomeIcon :size="48" fillColor="red" title="Go to homepage" />
    </p>
    <p>
      A purely decorative icon: <LightbulbOnOutlineIcon />
    </p>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import MenuIcon from 'vue-material-design-icons/Menu.vue';
import AndroidIcon from 'vue-material-design-icons/Android.vue';
import HomeIcon from 'vue-material-design-icons/Home.vue';
import LightbulbOnOutlineIcon from 'vue-material-design-icons/LightbulbOnOutline.vue';

export default defineComponent({
  name: 'App',
  components: {
    MenuIcon,
    AndroidIcon,
    HomeIcon,
    LightbulbOnOutlineIcon
  },
});
</script>

<style>
/* main.css or global styles */
@import 'vue-material-design-icons/styles.css'; /* Optional: for default scaling */

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

view raw JSON →