Hacker News new | ask | show | jobs
by player2121 2200 days ago
> What I am talking about is overriding styles by the user of the component.

Please take a look at theme spec where variants become part of your theme object. You use theme.js to provide custom variants to components. This is how you would let users to customize your components via well defined expressed API (typed with TS if you want) :-)

> One way to do it is through the ThemeProvider. But that does so globally.

You can have as many nested ThemeProviders as you want. This is not a hacky way but is the way if for some reason it's not enough for you to have 1 global theme object.

Material UI is great for what it does (implements said kind of design) but if material design is not what you want then using this library with its own layers of abstraction is a no go to me.