Simple component for Material Design Icons font in your React app.
npm install @hrc/material-icons @material-design-icons/font
-
Import
@material-design-icons/font
in your entry file (example:src/main.jsx
in Vite):import "@material-design-icons/font";
[!NOTE] Check @material-design-icons/font docs for more info.
-
Then, in your
App.jsx
or another file: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" /> </> ); }