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.9K
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.5K 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

292
240
3
The Next Generation of CSS in JS
292
240
+ 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

    130
    160
    2
    A CSS file in which all class names and animation names are scoped locally by default
    130
    160
    + 1
    2
    PROS OF CSS MODULES
    • 2
      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
              224
              A set of high-quality React components
              1.1K
              1.7K
              + 1
              224
              PROS OF ANT DESIGN
              • 48
                Lots of components
              • 33
                Polished and enterprisey look and feel
              • 21
                TypeScript
              • 21
                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
              • 2
                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

              42.6K
              31.7K
              3K
              Syntactically Awesome Style Sheets
              42.6K
              31.7K
              + 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

              Simon Reymann
              Senior Fullstack Developer at QUANTUSflow Software GmbH · | 24 upvotes · 4.9M views

              Our whole Vue.js frontend stack (incl. SSR) consists of the following tools:

              • Nuxt.js consisting of Vue CLI, Vue Router, vuex, Webpack and Sass (Bundler for HTML5, CSS 3), Babel (Transpiler for JavaScript),
              • Vue Styleguidist as our style guide and pool of developed Vue.js components
              • Vuetify as Material Component Framework (for fast app development)
              • TypeScript as programming language
              • Apollo / GraphQL (incl. GraphiQL) for data access layer (https://apollo.vuejs.org/)
              • ESLint, TSLint and Prettier for coding style and code analyzes
              • Jest as testing framework
              • Google Fonts and Font Awesome for typography and icon toolkit
              • NativeScript-Vue for mobile development

              The main reason we have chosen Vue.js over React and AngularJS is related to the following artifacts:

              • Empowered HTML. Vue.js has many similar approaches with Angular. This helps to optimize HTML blocks handling with the use of different components.
              • Detailed documentation. Vue.js has very good documentation which can fasten learning curve for developers.
              • Adaptability. It provides a rapid switching period from other frameworks. It has similarities with Angular and React in terms of design and architecture.
              • Awesome integration. Vue.js can be used for both building single-page applications and more difficult web interfaces of apps. Smaller interactive parts can be easily integrated into the existing infrastructure with no negative effect on the entire system.
              • Large scaling. Vue.js can help to develop pretty large reusable templates.
              • Tiny size. Vue.js weights around 20KB keeping its speed and flexibility. It allows reaching much better performance in comparison to other frameworks.
              See more
              Ali Soueidan
              Creative Web Developer at Ali Soueidan · | 18 upvotes · 1.2M views

              Application and Data: Since my personal website ( https://alisoueidan.com ) is a SPA I've chosen to use Vue.js, as a framework to create it. After a short skeptical phase I immediately felt in love with the single file component concept! I also used vuex for state management, which makes working with several components, which are communicating with each other even more fun and convenient to use. Of course, using Vue requires using JavaScript as well, since it is the basis of it.

              For markup and style, I used Pug and Sass, since they’re the perfect match to me. I love the clean and strict syntax of both of them and even more that their structure is almost similar. Also, both of them come with an expanded functionality such as mixins, loops and so on related to their “siblings” (HTML and CSS). Both of them require nesting and prevent untidy code, which can be a huge advantage when working in teams. I used JSON to store data (since the data quantity on my website is moderate) – JSON works also good in combo with Pug, using for loops, based on the JSON Objects for example.

              To send my contact form I used PHP, since sending emails using PHP is still relatively convenient, simple and easy done.

              DevOps: Of course, I used Git to do my version management (which I even do in smaller projects like my website just have an additional backup of my code). On top of that I used GitHub since it now supports private repository for free accounts (which I am using for my own). I use Babel to use ES6 functionality such as arrow functions and so on, and still don’t losing cross browser compatibility.

              Side note: I used npm for package management. 🎉

              *Business Tools: * I use Asana to organize my project. This is a big advantage to me, even if I work alone, since “private” projects can get interrupted for some time. By using Asana I still know (even after month of not touching a project) what I’ve done, on which task I was at last working on and what still is to do. Working in Teams (for enterprise I’d take on Jira instead) of course Asana is a Tool which I really love to use as well. All the graphics on my website are SVG which I have created with Adobe Illustrator and adjusted within the SVG code or by using JavaScript or CSS (SASS).

              See more
              Material-UI logo

              Material-UI

              2.3K
              3.6K
              445
              Material UI is a library of React UI components that implements Google's Material Design.
              2.3K
              3.6K
              + 1
              445
              PROS OF MATERIAL-UI
              • 141
                React
              • 82
                Material Design
              • 60
                Ui components
              • 30
                CSS framework
              • 26
                Component
              • 15
                Looks great
              • 13
                Responsive
              • 12
                Good documentation
              • 9
                LESS
              • 8
                Ui component
              • 7
                Open source
              • 6
                Flexible
              • 6
                Code examples
              • 5
                JSS
              • 3
                Supports old browsers out of the box
              • 3
                Interface
              • 3
                Angular
              • 3
                Very accessible
              • 3
                Fun
              • 2
                Typescript support
              • 2
                # of components
              • 2
                Designed for Server Side Rendering
              • 1
                Support for multiple styling systems
              • 1
                Accessibility
              • 1
                Easy to work with
              • 1
                Css
              CONS OF MATERIAL-UI
              • 36
                Hard to learn. Bad documentation
              • 29
                Hard to customize
              • 22
                Hard to understand Docs
              • 9
                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.4M 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

              I just finished tweaking styles details of my hobby project MovieGeeks (https://moviegeeks.co/): The minimalist Online Movie Catalog

              This time I want to share my thoughts on the Tech-Stack I decided to use on the Frontend: React, React Router, Material-UI and React-Apollo:

              1. React is by far the Front-End "framework" with the biggest community. Some of the newest features like Suspense and Hooks makes it even more awesome and gives you even more power to write clean UI's

              2. Material UI is a very solid and stable set of react components that not only look good, but also are easy to use and customize. This was my first time using this library and I am very happy with the result

              3. React-Apollo in my opinion is the best GraphQL client for a React application. Easy to use and understand and it gives you awesome features out of the box like cache. With libraries like react-apollo-hooks you can even use it with the hooks api which makes the code cleaner and easier to follow.

              Any feedback is much appreciated :)

              See more
              PostCSS logo

              PostCSS

              1.6K
              545
              49
              Transform CSS with JS plugins
              1.6K
              545
              + 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

                Dmitry Mukhin
                Engineer at Uploadcare · | 25 upvotes · 2.6M views

                Simple controls over complex technologies, as we put it, wouldn't be possible without neat UIs for our user areas including start page, dashboard, settings, and docs.

                Initially, there was Django. Back in 2011, considering our Python-centric approach, that was the best choice. Later, we realized we needed to iterate on our website more quickly. And this led us to detaching Django from our front end. That was when we decided to build an SPA.

                For building user interfaces, we're currently using React as it provided the fastest rendering back when we were building our toolkit. It’s worth mentioning Uploadcare is not a front-end-focused SPA: we aren’t running at high levels of complexity. If it were, we’d go with Ember.js.

                However, there's a chance we will shift to the faster Preact, with its motto of using as little code as possible, and because it makes more use of browser APIs. One of our future tasks for our front end is to configure our Webpack bundler to split up the code for different site sections. For styles, we use PostCSS along with its plugins such as cssnano which minifies all the code.

                All that allows us to provide a great user experience and quickly implement changes where they are needed with as little code as possible.

                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