Search code examples
reactjsstyled-components

UI libraries using styled components


I'm guessing not all UI frameworks are easily used together with styled components; since their specificity could be too high etc.

Am I correct in this regard?

Is there any pattern for styled components that allow them to work with any UI framework?

Is there a pattern to frameworks, that allows them to work really well with styled components, while not being written in it?

I know this could be subjective, but I am trying to ask about an objective pattern for interoperability.


Solution

  • I'm guessing not all ui frameworks are easily used together with styled components; since their specificity could be too high etc. Am I correct in this regard?

    No, styled-components works with any third party component library as long as the components attach the className internally to DOM node. See here the answer of Max Stoiber (co-creator of styled-components) in out of the discussions at GitHub.

    There is a binary-ui library, it uses styled-components it works with react and react-native as well.

    You can definitely use styled-components with a material-ui library and I guess with many other, I believe most of UI libraries allow using className prop.