Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I create a custom component library NPM package out of Material UI?

Basically I want to

  1. Have MaterialUI as the base package (@material-ui/core)
  2. Customize all or the required components as per my branding and style guide and generate my own component library as NPM package. (customize @material-ui/core and create own package like @myorg/core)
  3. Use those custom components in my project by installing the NPM package & importing. (npm install @myorg/core and import 'button' from '@myorg/core/button')

Because I want to create a common component library for different react applications.

enter image description here

Please let me know if that makes sense.

like image 288
sgm Avatar asked Aug 15 '20 22:08

sgm


1 Answers

Of course you can.

Creating a package is possible and even recommended if you want to reuse it in different applications or publish it.

Most of the packages are using another packages (called dependencies) and sometimes building new components on top of these packages' components. You can read more about dependencies here..

Packages with MIT License allows Modification as well.

More information about creating NodeJS modules can be found here.

And finally, if you are willing to publish the package in NPM, follow this.

like image 86
SomoKRoceS Avatar answered Oct 09 '22 11:10

SomoKRoceS