Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

mdi-react

levrik97.4k(MIT AND OFL-1.1)9.4.0TypeScript support: included

Material Design Icons for React

mdi, react, material, design, icons

readme

mdi-react npm package Material Design Icons version build status

Material Design Icons for React/Preact packaged as single components

New v9.4.0 released: See CHANGELOG.md

Installation

npm install mdi-react
# or if you use Yarn
yarn add mdi-react

Support for Preact is available via the mdi-preact package.
The mdi-preact package supports class as alternative to className.

Usage

Just search for an icon on materialdesignicons.com and look for its name.
The name translates to PascalCase followed by the suffix Icon in mdi-react.
Also it's possible to import with an alias. You can find them on the detail page of the respective icon.

For example the icons named alert and alert-circle:

import AlertIcon from 'mdi-react/AlertIcon';
import AlertCircleIcon from 'mdi-react/AlertCircleIcon';

const MyComponent = () => {
  return (
    <div>
      {/* The default color is the current text color (currentColor) */}
      <AlertIcon color="#fff" />
      {/* The default size is 24 */}
      <AlertCircleIcon className="some-class" size={16} />
      {/* This sets the icon size to the current font size */}
      <AlertIcon size="1em" />
    </div>
  );
};

To change the color on hover you can just use your own class and plain CSS.

.some-class:hover {
  fill: red;
}

You can also add default styling via the mdi-icon class.

.mdi-icon {
  background-color: green;
}

changelog

Changelog

This page only documents changes to the library itself, not the icons. Please refer to the mdi history for that.

9.4.0 Material Design Icons version

No changes

9.3.0 Material Design Icons version

No changes

9.2.0 Material Design Icons version

No changes

9.1.0 Material Design Icons version

Changes

  • ea0580f #103 Support module modes node16 and nodenext in TypeScript

9.0.0 Material Design Icons version

No changes

8.6.0 Material Design Icons version

No changes

8.5.0 Material Design Icons version

No changes

8.4.0 Material Design Icons version

No changes

8.3.1 Material Design Icons version

No changes

8.3.0 Material Design Icons version

No changes

8.2.0 Material Design Icons version

No changes

8.1.0 Material Design Icons version

No changes

8.0.0 Material Design Icons version

No changes

7.5.0 Material Design Icons version

No changes

7.4.0 Material Design Icons version

No changes

7.3.0 Material Design Icons version

No changes

7.2.0 Material Design Icons version

No changes

7.1.0 Material Design Icons version

No changes

7.0.0 Material Design Icons version

No changes

6.7.0 Material Design Icons version

No changes

6.6.0 Material Design Icons version

No changes

6.5.0 Material Design Icons version

No changes

6.4.0 Material Design Icons version

  • a81857d #50 Add SVG element props to TS definitions

6.3.0 Material Design Icons version

No changes

6.2.0 Material Design Icons version

No changes

6.1.0 Material Design Icons version

No changes

6.0.0 Material Design Icons version

No changes

5.6.0 Material Design Icons version

No changes

5.5.0 Material Design Icons version

No changes

5.4.0 Material Design Icons version

New features

5.3.0 Material Design Icons version

No changes

5.2.0 Material Design Icons version

No changes

5.1.0 Material Design Icons version

Fixes

  • d5bb1cf Removed main and module from package.json. These files were removed in 5.0.0.

5.0.0 Material Design Icons version

Breaking changes

  • 07ec6a1 Removed ES module (see commit message for details)

4.4.0 Material Design Icons version

No changes

4.3.0 Material Design Icons version

No changes

4.2.0 Material Design Icons version

No changes

4.1.0 Material Design Icons version

No changes

4.0.0 Material Design Icons version

Breaking changes

  • 48126a3 #33 Changed default color of icons to the current text color (currentColor).

3.4.0 Material Design Icons version

No changes

3.3.0 Material Design Icons version

New features

  • 7ee6784 Support for Preact via mdi-preact package. Thanks to @GusRuss89 for his initial work.
  • 49d94b3 Support import of aliases.

3.2.0 Material Design Icons version

No changes

3.1.0 Material Design Icons version

No changes

3.0.0 Material Design Icons version

Breaking changes

  • Removed width and height props. Use size instead.

New features