Written on 2024-04-10 by Adam Drake - 10 min read
I currently work as the Lead Frontend Developer at my work. When I joined the company they didn’t have any Frontend Developers so I was the first and with that came a bunch of important decisions.
Luckily for me, the community in the Frontend world is great and there is enough information out there and enough great tools that it’s not overly complex to pick a bunch of tools that will serve you well.
However, when it came to deciding about styling it was a little more tricky. I played with the idea of building our own component library and styling everything from scratch but then when trying this approach out on a simple button I realised that building a component library is not a quick endeavour. There is so much to think about and so many edge cases to cover that it was better for me to choose an existing component library.
There are also plenty of warnings out there about going with an existing component library but in my opinion, it really depends on your situation. If you have a designer and a few Frontend developers and a clear vision of what your whole style will be like then sure, a custom component library could be the best way forward. However, I was a loan Frontend developer who had to build rapid prototypes in order to show potential investors in order to raise capital for our small company. I needed to go with an existing solution.
When I had made this decision it was time to whittle down a shortlist. I have used quite a few component libraries over the years so this was the list I came up with:
There are some more but these were the main ones I was seriously looking at.
Let’s start with Bootstrap.
For some reason, I have noticed that amongst seasoned developers Bootstrap is quickly dismissed, even mocked sometimes. “You used Bootstrap?! Why?!” I would hear it in some mocking tone like this library is somehow beneath them.
On the flip side, it seems to be the go-to library for junior developers or backend developers who just want to put together some quick-and-dirty UI. Which I also find interesting. It’s not like it’s really any easier to use than the other libraries and it’s not as if it looks better but still seems the default choice in many situations.
Bootstrap (at the time of writing this) is on version 5. If you check out the documentation you find there are a fair number of components and plenty of options in terms of customisation.
For my situation, I didn’t choose it mainly due to the fact it was utility class based and I didn’t think the default styling really suited the use case of the applications I had to build. It’s pretty easy to recognise an MVP built with Bootstrap and it reminds me of the apps that used to get built when Bootstrap first came out. They were always clunky and just looked… like Bootstrap apps. I just don’t like the design. Maybe I am a developer snob after all.
With HeadlessUI I quickly dismissed it for two reasons:
It basically came down to the best use of my time. Whilst I would enjoy the whole process of building out a design library I really didn’t have that luxury.
This one really intrigued me.
I really like their documentation. I really like all the examples they give. It makes it very easy for a developer to understand how to use the components and the options each component provides. They have a long list of useful components. Components like pagination and timepicker were very appealing to me as I knew I would need these in the projects I was working on. It’s also a mature library currently on version 5.
So why didn’t I ultimately go with this library? I think this comes down to very irrational reasons:
All in all, I think it would be a great component library and one I definitely intend to use in some of my upcoming personal projects.
I’ve actually used Chakra-UI quite a few times on personal projects and I quite liked it. However, I didn’t feel it was the right pick for this project for a number of reasons:
It’s a little thing I guess but if I am going to be using a component library for a long project and spend many working hours with it, the little things matter.
So ultimately it just didn’t provide the best option for me.
Like many React developers I have used Material UI quite a bit in the past so I was very familiar with it. It has much going for it — it’s got resources, it’s got a wide user base, it’s constantly being worked on and improved, it’s reliable and well-tested and its documentation is really good.
So why did I not choose it for this big project I was working on? For me, there were a couple of reasons:
I have to admit that none of these reasons are good solid reasons, and that is often the case when making some decisions in life. It comes down to a gut feeling which can’t always be explained by cold hard logic.
My guy was telling me to go with Mantine. I first discovered it when watching one of Jack Herrington’s excellent YouTube videos. I checked out the Mantine documentation and straight away I was impressed with both the layout of the documentation and the extent of components available. It’s also regularly maintained with releases coming out almost weekly.
The default style also appealed to me and from all the libraries I had looked at, this was the style that most closely aligned with what I was envisioning. It has a good range of components, more than some libraries like Mui or Bootstrap and it seemed fairly intuitive to use.
Also in Version 7 (current version as I write this), they migrated the styling to native CSS. It no longer depended on Emotion for styles generation. This is a positive change I feel as it improves performance, reduces the bundle size of the library, and allows using Mantine in environments where CSS-in-JS is not supported. Native CSS has come a long way recently so it’s good it can be used in a library such as this.
It’s 12 months or so since I started using this library and I am still very happy with the decision. The apps I have built with it look really good and I am using many of the components that come from Mantine. It certainly hasn’t disappointed me!
Honestly, in the Frontend world, we are spoilt for choice when it comes to styling our apps. There are so many talented developers making wonderful libraries (all free to use) that we can just import and start using straight away. I think if you chose any of the libraries in the list I started with, you would have a good developer experience and your app would, from a stylistic point of view, look very nice.
I think it’s also important to try out different libraries and not just stick to one. You learn different approaches, you see what works well and maybe what doesn’t work so well and you expand your experience as a developer.
Loading...
Adam Drake is a Frontend React Developer who is very passionate about the quality of the web. He lives with his wife and three children in Prague in the Czech Republic.
Adam Drakes Site © 2024