Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot use MUI 'ContentCopy' icon

I am trying to use the icon 'ContentCopy' from MUI.

https://mui.com/components/material-icons/ says to use the following import:

import ContentCopyIcon from '@mui/icons-material/ContentCopy';

No matter what I do, I get the error:

Module not found: Can't resolve '@mui/icons-material/

I have already tried the following:

npm install @material-ui/core
npm install @material-ui/icons

I also tried deleting my node-modules and re-running npm install.

Any ideas on what else I could try??

like image 814
Neel Avatar asked May 09 '26 23:05

Neel


1 Answers

It seems that you confused of using version 4 and 5.

You need to install the icons of version 5.

npm install @mui/icons-material

And import the icon from the module.

import ContentCopyIcon from '@mui/icons-material/ContentCopy';

Please refer to this.

like image 124
hotcakedev Avatar answered May 11 '26 12:05

hotcakedev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!