Sarmad Asif
Sarmad Asif

Reputation: 89

Use my own styles with 3rd party React.js component libraries

I am using Material UI as a component library in my React project. I want to use the functionality of the components but use my own styles that I have written over the year. Since Material UI comes with its own inline styling, that overrides my styles, can I somehow control the styles?

Upvotes: 0

Views: 809

Answers (1)

Matt
Matt

Reputation: 3780

Yes you can, but since you mention inline styles, it sounds like you are using v0.x. If so, you would have to override the default styles with !important.

With v1.0 there is much more more flexibility, as it uses CSS classes that you can more easily override, either using the className prop to affect the root component, or the classes prop to target multiple classes.

The classes you can override are listed in the API docs.

Upvotes: 1

Related Questions