9.4.0 • Published 4 months ago

mdi-preact v9.4.0

Weekly downloads
13
License
(MIT AND OFL-1.1)
Repository
github
Last release
4 months ago

mdi-preact npm package Material Design Icons version build status

Material Design Icons for Preact/React packaged as single components

New v9.4.0 released: See CHANGELOG.md

Installation

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

Support for React is available via the mdi-react package.

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-preact.
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-preact/AlertIcon';
import AlertCircleIcon from 'mdi-preact/AlertCircleIcon';

const MyComponent = () => {
  return (
    <div>
      {/* The default color is the current text color (currentColor) */}
      <AlertIcon color="#fff" />
      {/* The default size is 24 */}
      <AlertCircleIcon class="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;
}
9.4.0

4 months ago

9.3.0

7 months ago

9.2.0

1 year ago

9.1.0

1 year ago

8.5.0

2 years ago

8.4.0

2 years ago

8.6.0

2 years ago

9.0.0

2 years ago

8.3.1

2 years ago

8.3.0

2 years ago

8.2.0

2 years ago

8.1.0

3 years ago

8.0.0

3 years ago

7.5.0

3 years ago

7.4.0

4 years ago

7.3.0

4 years ago

7.2.0

4 years ago

7.1.0

4 years ago

7.0.0

4 years ago

6.7.0

4 years ago

6.6.0

4 years ago

6.5.0

4 years ago

6.4.0

4 years ago

6.3.0

4 years ago

6.2.0

5 years ago

6.1.0

5 years ago

6.0.0

5 years ago

5.6.0

5 years ago

5.5.0

5 years ago

5.4.0

5 years ago

5.3.0

5 years ago

5.2.0

5 years ago

5.1.0

5 years ago

5.0.0

6 years ago

4.4.0

6 years ago

4.3.0

6 years ago

4.2.0

6 years ago

4.1.0

6 years ago

4.0.0

6 years ago

3.4.0

6 years ago

3.3.0

6 years ago

2.0.46

7 years ago