className
prop will replace the default icon styles, defaultColor and inactive styles. Own styles for these should be provided if className prop is defined.This package provides a convenient react component for using Google's Material Icons in your react application.
Import module using the following statement.
import MaterialIcon, {colorPalette} from 'material-icons-react';
<MaterialIcon icon="dashboard" />
<MaterialIcon icon="alarm_on" />
size
property.<MaterialIcon icon="dashboard" size='large' />
<MaterialIcon icon="dashboard" size={100} />
<MaterialIcon icon="dashboard" invert />
inactive
property.
<MaterialIcon icon="dashboard" inactive />
<MaterialIcon icon="dashboard" color={colorPalette.amber._200} />
<MaterialIcon icon="dashboard" color={colorPalette.amber.A700} />
<MaterialIcon icon="dashboard" color='#7bb92f' />
.lds-ripple {
display: inline-block;
position: relative;
width: 64px;
height: 64px;
}
.lds-ripple div {
position: absolute;
border: 4px solid #921515;
opacity: 1;
border-radius: 50%;
animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.lds-ripple div:nth-child(2) {
animation-delay: -0.5s;
}
let loader = <div className="lds-ripple"><div></div><div></div></div>
<MaterialIcon icon="dashboard" preloader={loader} />
Alias | Size |
---|---|
tiny | 18px |
small | 24px |
medium | 36px |
large | 48px |
Please feel free to create PR for any improvements and contributions.
MIT