Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material-UI include only certain component

I just want to include material ui dialogs in my project. I do not want to include other components in my project. So I don't want to install full material ui just to use dialogs. Can anyone help with this?

https://material-ui.com/components/dialogs/

like image 579
beyond20g5 Avatar asked Jul 01 '26 14:07

beyond20g5


1 Answers

According to the documentation,

Tree-shaking of Material-UI works out of the box in modern frameworks. Material-UI exposes its full API on the top-level @material-ui import.

Which means importing exactly what you're using will not result into the inclusion of other parts of @material-ui/ in your production build.

Note all of their examples import only the bits used in that particular example, so figuring out what your project needs for each case should not be difficult. Besides, whenever you're missing something, you'll get a descriptive error message about it, telling you exactly what you missed.

like image 96
tao Avatar answered Jul 04 '26 03:07

tao



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!