How to use Styled Components with Material UI (MUI) in React

Ben Grunfeld
1 min readMar 9, 2023

I just worked on a project that used both Material UI (MUI) and Styled Components in React (well, Next.JS but same same).

Anywho, I was trying to style a simple MU IDialog box with Styled Components and for the life of me I just couldn’t do it. I tried targeting the Dialog classNames directly but no dice, and because we’re on v4 of MUI, I couldn’t use sx.

Eventually I asked my boss for help and he said I needed to override the styles in the Theme Provider… what??! Hell’s no. That didn’t sound like a…

--

--

Ben Grunfeld

I’m a Front End Engineer who loves React, NextJS, and GraphQL. Looking for a developer in #Israel? Contact me at: https://www.linkedin.com/in/bengrunfeld/