DEV Community

Cover image for Should you build your own React component library?
YulyGP for React Rainbow

Posted on • Updated on

Should you build your own React component library?

4 Advantages of Using a React Component Library, Three Musketeers and a D’Artagnan

It seems that nowadays every software company is creating its own component libraries. Why? Well, technology companies around the world have realized the only way to scale their software solution is by building reusable components.

Most businesses have to develop multiple projects, and in doing so, usually need to follow the same design guidelines. By way of example, Google offers several products such as Gmail, Google Docs, Google Analytics, and several others. You’ll notice that these projects all have similar user interfaces, that’s because Google leverages their own component library to cut down on development time and provide a consistent experience for their users across their applications.

However, for smaller companies that lack the resources of Google, building a reusable UI component library can be timely and cost prohibitive. Big companies are developing component libraries because they can afford to have what is called “platform teams” that support other developers inside the company by building things like component libraries so they can build software faster.

So if you’re a small or medium-sized business or especially a new startup, you’ll likely not have the resources available to build your own component library. Fortunately, there are several reliable and open source component libraries that already exist and most importantly are free! By using an open source library, smaller companies are able to take full advantage of the benefits of utilizing a component library without worrying about the cost or time of building their own.

To better understand the advantages of using an open source library let’s take a look at some key benefits of using them.

Benefits

  • Ready To Use: a component library is a robust set of ready-made UI components such as badges, buttons, tables, and so on. With a simple import, the library is ready to be used. Often, you just have to copy and paste code snippets to make it work.

  • Time Efficient: you can mix and match the existing components to create your project so you can save time by not building everything from the beginning. It also reduces decision-making time from not having to design components APIs that work for all your use cases.

  • Developer Friendly: components are carefully designed, well-documented, and well-organized by professionals. This will help you easily understand what you need to do, and shorten development and maintenance time. Plus if you’re a developer with not much design knowledge, you can effortlessly create elegant layouts and provide a nice UX for your users.

  • Consistency: adopting a component library will give you a consistent UI and UX across your project. Meaning you don’t have to worry about your project having different designers working at the same time with inconsistent designs. Everything will remain uniform.

Not to mention, that since these libraries are open source they are free! Meaning no need to get buy in or invest in leveraging these libraries.

How to evaluate component libraries

Like any other tool, open-sourced component libraries aren’t perfect and it won’t suit every use case you may have.
Based on my own experience, most of the gaps in open source component libraries are related to customization, accessibility, and testing.

So you should consider the following while evaluating component libraries:

  • Does your project demand a lot of customization?
  • Are you working on a government project that requires by law accessibility compliance?
  • How well-tested are the components in the library you selected?

While you analyze your project’s needs be sure to check out these top 3 component libraries, plus one that has been getting noticed lately by the community.

Three Musketeers on the market… and D’Artagnan

If you decide that a component library is a good fit for your project, here are 3 of the most popular and useful React component libraries, frequently mentioned in tech blogs and platforms like medium.com and dev.to:

  • Material-UI
  • Ant Design
  • Semantic UI

These libraries have a good reputation in the community and will help you build your React project with a great UI. They have tons of stars on GitHub, a bunch of high-quality components out of the box, flexibility in customizing components, as well as some other great features. They’re big, they’re good, and have been in the market for some time, but what about D’Artagnan?

I strongly believe that we have to make room for new things, like when the old trio of musketeers accepted a new member in the iconic Alexandre Dumas’ novel. I believe, in this case, D’Artagnan is Rainbow UI.

Rainbow UI is an open source React component library designed for enterprise-level products. Its features include internationalization, accessibility, and most importantly, they eliminate frustrating breaking changes.

Rainbow UI offers over 90 components, which is more than Material, Semantic, and Ant Design. Providing you greater options and customization for your project.

Rainbow UI also includes several modules and interactive examples so you can build a better product, faster. With the modules and interactive examples, this allows you to be ahead of the game in comparison to traditional options like our Three Musketeers listed above.

For all my latest projects, we’ve used Rainbow UI and aren’t planning on switching back anytime soon. Ultimately, you can’t be wrong in any of the options listed above.

Tell us in the comment section below what’s important while you’re evaluating component libraries and which library you typically utilize.

Top comments (1)

Collapse
 
wannabehexagon profile image
ItsThatHexagonGuy • Edited

I'd say if you have an idea of what your design language should be like and how you generally want to present your brand, then starting with a mix of tailwind and styled-components/emotion helps a lot. If not, which is most of the time, you should use a css/component framework.

I am SO thankful for component framework authors because I don't enjoy writing my own CSS. You should try out Chakra UI btw, it's pretty awesome too :) Looks a lot like tailwind.