Alternatives to styled-components logo

Alternatives to styled-components

Emotion, CSS Modules, CSS Blocks, Radium, and Ant Design are the most popular alternatives and competitors to styled-components.
1.8K
601
+ 1
12

What is styled-components and what are its top alternatives?

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
styled-components is a tool in the JavaScript Framework Components category of a tech stack.
styled-components is an open source tool with 40.1K GitHub stars and 2.5K GitHub forks. Here’s a link to styled-components's open source repository on GitHub

Top Alternatives to styled-components

  • Emotion
    Emotion

    Emotion is a performant and flexible CSS-in-JS library. Building on many other CSS-in-JS libraries, it allows you to style apps quickly with string or object styles. It has predictable composition to avoid specificity issues with CSS. With source maps and labels, Emotion has a great developer experience and great performance with heavy caching in production. ...

  • CSS Modules
    CSS Modules

    It is a CSS file in which all class names and animation names are scoped locally by default. The key words here are scoped locally. With this, your CSS class names become similar to local variables in JavaScript. It goes into the compiler, and CSS comes out the other side. ...

  • CSS Blocks
    CSS Blocks

    By combining an opinionated authoring system, build-time analysis and rewriting of templates, and a new type of CSS optimizer, css-blocks breathes new power and ease of use into the technologies and best practices that stylesheet developers already know and love. ...

  • Radium
    Radium

    Radium is a set of tools to manage inline styles on React elements. It gives you powerful styling capabilities without CSS. ...

  • Ant Design
    Ant Design

    An enterprise-class UI design language and React-based implementation. Graceful UI components out of the box, base on React Component. A npm + webpack + babel + dora + dva development framework. ...

  • Sass
    Sass

    Sass is an extension of CSS3, adding nested rules, variables, mixins, selector inheritance, and more. It's translated to well-formatted, standard CSS using the command line tool or a web-framework plugin. ...

  • Material-UI
    Material-UI

    Material UI is a library of React UI components that implements Google's Material Design. ...

  • PostCSS
    PostCSS

    PostCSS is a tool for transforming CSS with JS plugins. These plugins can support variables and mixins, transpile future CSS syntax, inline images, and more. ...

styled-components alternatives & related posts

Emotion logo

Emotion

279
239
3
The Next Generation of CSS in JS
279
239
+ 1
3
PROS OF EMOTION
  • 3
    Easy to use
CONS OF EMOTION
    Be the first to leave a con

    related Emotion posts

    Robert Zuber

    We are in the process of adopting Next.js as our React framework and using Storybook to help build our React components in isolation. This new part of our frontend is written in TypeScript, and we use Emotion for CSS/styling. For delivering data, we use GraphQL and Apollo. Jest, Percy, and Cypress are used for testing.

    See more
    Johnny Bell

    For Stack Decisions I needed to add Markdown in the decision composer to give our users access to some general styling when writing their decisions. We used React & GraphQL on the #Frontend and Ruby & GraphQL on the backend.

    Instead of using Showdown or another tool, We decided to parse the Markdown on the backend so we had more control over what we wanted to render in Markdown because we didn't want to enable all Markdown options, we also wanted to limit any malicious code or images to be embedded into the decisions and Markdown was a fairly large to import into our component so it was going to add a lot of kilobytes that we didn't need.

    We also needed to style how the markdown looked, we are currently using Glamorous so I used that but we are planning to update this to Emotion at some stage as it has a fairly easy upgrade path rather than switching over to styled-components or one of the other cssInJs alternatives.

    Also we used React-Mentions for tagging tools and topics in the decisions. Typing @ will let you tag a tool, and typing # will allow you to tag a topic.

    The Markdown options that we chose to support are tags: a, code, u, b, em, pre, ul, ol, li.

    If there are anymore tags you'd love to see added in the composer leave me a comment below and we will look into adding them.

    #StackDecisionsLaunch

    See more
    CSS Modules logo

    CSS Modules

    129
    158
    1
    A CSS file in which all class names and animation names are scoped locally by default
    129
    158
    + 1
    1
    PROS OF CSS MODULES
    • 1
      Static rather than compiled at runtime
    CONS OF CSS MODULES
      Be the first to leave a con

      related CSS Modules posts

      CSS Blocks logo

      CSS Blocks

      27
      36
      0
      A component-oriented CSS authoring system by LinkedIn
      27
      36
      + 1
      0
      PROS OF CSS BLOCKS
        Be the first to leave a pro
        CONS OF CSS BLOCKS
          Be the first to leave a con

          related CSS Blocks posts

          Radium logo

          Radium

          17
          34
          0
          A toolchain for React component styling
          17
          34
          + 1
          0
          PROS OF RADIUM
            Be the first to leave a pro
            CONS OF RADIUM
              Be the first to leave a con

              related Radium posts

              Ant Design logo

              Ant Design

              1.1K
              1.7K
              221
              A set of high-quality React components
              1.1K
              1.7K
              + 1
              221
              PROS OF ANT DESIGN
              • 47
                Lots of components
              • 33
                Polished and enterprisey look and feel
              • 21
                TypeScript
              • 20
                Easy to integrate
              • 18
                Es6 support
              • 17
                Typescript support
              • 17
                Beautiful and solid
              • 16
                Beautifully Animated Components
              • 15
                Quick Release rhythm
              • 14
                Great documentation
              • 2
                Easy to customize Forms
              • 1
                Opensource and free of cost
              CONS OF ANT DESIGN
              • 24
                Less
              • 10
                Large File Size
              • 4
                Poor accessibility support
              • 3
                Dangerous to use as a base in component libraries

              related Ant Design posts

              Sarmad Chaudhary
              Founder & CEO at Ebiz Ltd. · | 9 upvotes · 1.3M views

              Hi there!

              I just want to have a simple poll/vote...

              If you guys need a UI/Component Library for React, Vue.js, or AngularJS, which type of library would you prefer between:

              1 ) A single maintained cross-framework library that is 100% compatible and can be integrated with any popular framework like Vue, React, Angular 2, Svelte, etc.

              2) A native framework-specific library developed to work only on target framework like ElementUI for Vue, Ant Design for React.

              Your advice would help a lot! Thanks in advance :)

              See more

              Hello, A question to frontend developers. I am a beginner on frontend.

              I am building a UI for my company to replace old legacy one with React and this question is about choosing how to apply design to it.

              I have Tailwind CSS on one hand and Ant Design on the other (I didnt like mui and Bootstrap doesn't seem to have enterprise components as ant) As far as I understand, tailwind is great. It allows me to literally build an application without touching the css but I have to build my own react components with it. Ant design or mantine has ready to use components which I can use and rapidly build my application.

              My question is, is it the right approach to: - Use a component framework for now and replace legacy app. - Introduce tailwind later when I have a frontend resource in hand and then build own component library

              Thank you.

              See more
              Sass logo

              Sass

              41.7K
              31.1K
              3K
              Syntactically Awesome Style Sheets
              41.7K
              31.1K
              + 1
              3K
              PROS OF SASS
              • 613
                Variables
              • 594
                Mixins
              • 466
                Nested rules
              • 410
                Maintainable
              • 300
                Functions
              • 149
                Modular flexible code
              • 143
                Open source
              • 112
                Selector inheritance
              • 107
                Dynamic
              • 96
                Better than cs
              • 5
                Used by Bootstrap
              • 3
                If and for function
              • 2
                Better than less
              • 1
                Inheritance (@extend)
              • 1
                Custom functions
              CONS OF SASS
              • 6
                Needs to be compiled

              related Sass posts

              Islam Diab
              Full-stack Developer at Freelancer · | 9 upvotes · 168.5K views

              Hi, I want to start freelancing, I have two years of experience in web development, and my skills in web development: HTML CSS JavaScript [basic, Object-Oriented Programming, Document object model, and browser object model] jQuery Bootstrap 3, 4 Pre-processor -> Sass Template Engine with Pug.js Task Runner with Gulp.js and Webpack Ajax JSON JavaScript Unit testing with jest framework Vue.js

              Node.js [Just basic]

              My Skills in Back end development Php [Basic, and Object-Oriented Programming] Database management system with MySql for database relationships and MongoDB for database non-relationships architecture pattern with MVC concept concept of SOLID Unit testing with PHPUnit Restful API

              Laravel Framework

              and version control with GitHub ultimately, I want to start working as a freelancer full time. Thanks.

              See more

              ReactQL is a React + GraphQL front-end starter kit. #JSX is a natural way to think about building UI, and it renders to pure #HTML in the browser and on the server, making it trivial to build server-rendered Single Page Apps. GraphQL via Apollo was chosen for the data layer; #GraphQL makes it simple to request just the data your app needs, and #Apollo takes care of communicating with your API (written in any language; doesn't have to be JavaScript!), caching, and rendering to #React.

              ReactQL is written in TypeScript to provide full types/Intellisense, and pick up hard-to-diagnose goofs that might later show up at runtime. React makes heavy use of Webpack 4 to handle transforming your code to an optimised client-side bundle, and in throws back just enough code needed for the initial render, while seamlessly handling import statements asynchronously as needed, making the payload your user downloads ultimately much smaller than trying to do it by hand.

              React Helmet was chosen to handle <head> content, because it works universally, making it easy to throw back the correct <title> and other tags on the initial render, as well as inject new tags for subsequent client-side views.

              styled-components, Sass, Less and PostCSS were added to give developers a choice of whether to build styles purely in React / JavaScript, or whether to defer to a #css #preprocessor. This is especially useful for interop with UI frameworks like Bootstrap, Semantic UI, Foundation, etc - ReactQL lets you mix and match #css and renders to both a static .css file during bundling as well as generates per-page <style> tags when using #StyledComponents.

              React Router handles routing, because it works both on the server and in the client. ReactQL customises it further by capturing non-200 responses on the server, redirecting or throwing back custom 404 pages as needed.

              Koa is the web server that handles all incoming HTTP requests, because it's fast (TTFB < 5ms, even after fully rendering React), and its natively #async, making it easy to async/await inside routes and middleware.

              See more
              Material-UI logo

              Material-UI

              2.2K
              3.6K
              441
              Material UI is a library of React UI components that implements Google's Material Design.
              2.2K
              3.6K
              + 1
              441
              PROS OF MATERIAL-UI
              • 141
                React
              • 82
                Material Design
              • 60
                Ui components
              • 30
                CSS framework
              • 25
                Component
              • 14
                Looks great
              • 12
                Responsive
              • 12
                Good documentation
              • 9
                LESS
              • 8
                Ui component
              • 7
                Open source
              • 6
                Code examples
              • 6
                Flexible
              • 5
                JSS
              • 3
                Angular
              • 3
                Very accessible
              • 3
                Fun
              • 3
                Supports old browsers out of the box
              • 2
                Typescript support
              • 2
                # of components
              • 2
                Interface
              • 2
                Designed for Server Side Rendering
              • 1
                Support for multiple styling systems
              • 1
                Css
              • 1
                Easy to work with
              • 1
                Accessibility
              CONS OF MATERIAL-UI
              • 35
                Hard to learn. Bad documentation
              • 28
                Hard to customize
              • 21
                Hard to understand Docs
              • 8
                Bad performance
              • 7
                Extra library needed for date/time pickers
              • 7
                For editable table component need to use material-table
              • 2
                Typescript Support
              • 1
                # of components

              related Material-UI posts

              Adebayo Akinlaja
              Engineering Manager at Andela · | 30 upvotes · 3.3M views

              I picked up an idea to develop and it was no brainer I had to go with React for the frontend. I was faced with challenges when it came to what component framework to use. I had worked extensively with Material-UI but I needed something different that would offer me wider range of well customized components (I became pretty slow at styling). I brought in Evergreen after several sampling and reads online but again, after several prototype development against Evergreen—since I was using TypeScript and I had to import custom Type, it felt exhaustive. After I validated Evergreen with the designs of the idea I was developing, I also noticed I might have to do a lot of styling. I later stumbled on Material Kit, the one specifically made for React . It was promising with beautifully crafted components, most of which fits into the designs pages I had on ground.

              A major problem of Material Kit for me is it isn't written in TypeScript and there isn't any plans to support its TypeScript version. I rolled up my sleeve and started converting their components to TypeScript and if you'll ask me, I am still on it.

              In summary, I used the Create React App with TypeScript support and I am spending some time converting Material Kit to TypeScript before I start developing against it. All of these components are going to be hosted on Bit.

              If you feel I am crazy or I have gotten something wrong, I'll be willing to listen to your opinion. Also, if you want to have a share of whatever TypeScript version of Material Kit I end up coming up with, let me know.

              See more

              My React website is a simple 5-pager that attaches to a database to store and display registrations and other data. The user (small user base) can change any form elements, but I don't need theme-ing, though that would be fun for the user. reactstrap/react-bootstrap built on Bootstrap 4 sounds dated. I am familiar with reactstrap, but a friend said to try Material-UI. The thought of learning it is interesting, but somehow I think it might be overkill. So... reactstrap, react-bootstrap, or Material UI, which should I use?

              See more
              PostCSS logo

              PostCSS

              1.3K
              538
              49
              Transform CSS with JS plugins
              1.3K
              538
              + 1
              49
              PROS OF POSTCSS
              • 21
                The "babel" of CSS
              • 15
                Customizable
              • 8
                Autoprefixer
              • 2
                Variables
              • 1
                Mixins
              • 1
                CSS MQPacker
              • 1
                PostCSS Flexbugs Fixes
              CONS OF POSTCSS
                Be the first to leave a con

                related PostCSS posts

                ReactQL is a React + GraphQL front-end starter kit. #JSX is a natural way to think about building UI, and it renders to pure #HTML in the browser and on the server, making it trivial to build server-rendered Single Page Apps. GraphQL via Apollo was chosen for the data layer; #GraphQL makes it simple to request just the data your app needs, and #Apollo takes care of communicating with your API (written in any language; doesn't have to be JavaScript!), caching, and rendering to #React.

                ReactQL is written in TypeScript to provide full types/Intellisense, and pick up hard-to-diagnose goofs that might later show up at runtime. React makes heavy use of Webpack 4 to handle transforming your code to an optimised client-side bundle, and in throws back just enough code needed for the initial render, while seamlessly handling import statements asynchronously as needed, making the payload your user downloads ultimately much smaller than trying to do it by hand.

                React Helmet was chosen to handle <head> content, because it works universally, making it easy to throw back the correct <title> and other tags on the initial render, as well as inject new tags for subsequent client-side views.

                styled-components, Sass, Less and PostCSS were added to give developers a choice of whether to build styles purely in React / JavaScript, or whether to defer to a #css #preprocessor. This is especially useful for interop with UI frameworks like Bootstrap, Semantic UI, Foundation, etc - ReactQL lets you mix and match #css and renders to both a static .css file during bundling as well as generates per-page <style> tags when using #StyledComponents.

                React Router handles routing, because it works both on the server and in the client. ReactQL customises it further by capturing non-200 responses on the server, redirecting or throwing back custom 404 pages as needed.

                Koa is the web server that handles all incoming HTTP requests, because it's fast (TTFB < 5ms, even after fully rendering React), and its natively #async, making it easy to async/await inside routes and middleware.

                See more
                awesomebanana2018
                Shared insights
                on
                PostCSSPostCSSStylusStylusSassSass

                Originally, I was going to start using Sass with Parcel, but then I learned about Stylus, which looked interesting because it can get the property values of something directly instead of through variables, and PostCSS, which looked interesting because you can customize your Pre/Post-processing. Which tool would you recommend?

                See more