@hrc/material-icons
Simple component for Material Design Icons font in your React app
Demo generated with code from Usage section
Installation
npm install @hrc/material-icons @material-design-icons/fontpnpm add @hrc/material-icons @material-design-icons/fontyarn add @hrc/material-icons @material-design-icons/fontUsage
-
Import
@material-design-icons/fontin your entry file (example:src/main.jsxinVite):import "@material-design-icons/font"; -
Use the component in your project:
import { Icon } from "@hrc/material-icons";export function PackageDemo() {return (<><Icon name="lock" variant="outlined" size="small" /><Icon name="favorite" color="error" /><Icon name="face" color="secondary" /><Icon name="description" color="primary" size="large" /></>);}
Demos
For examples and details on the usage of the component, see the demo page:
API
See documentation below for reference to all of the props, classes and CSS variables (custom properties) available for icon component: