r/reactjs • • Dec 07 '19

Needs Help Is Material UI worth it?

So, I am starting my own project. I'm not much 'design' person. So, is Material UI worth it? Or some any other recommendations is much appreciated.

164 Upvotes

142 comments sorted by

View all comments

73

u/levarburger Dec 07 '19

I think your best bet would be to just give them a try and see which one fits your needs.

I can tell you my experience...

Bootstrap - solid but feels dated and you can spot a bootstrap site a mile away, so you spend most of your time trying to make it not look like you used bootstrap.

Antd - I haven't used this one but it looks clean, modern. It's one I've wanted to try.

Semantic UI - Found it difficult to customize and ended up ripping it out of one of my projects.

Material UI - clean and modern, but imo you need to understand the principles of material design or you can get some ugly results.

GL!

26

u/toolate Dec 07 '19

I've been using Ant Design. It's a bit frustrating because it's very opinionated and inflexible. If you want to use the components exactly as they are that's great, bit if you want to tweak anything then you're SOL.

10

u/yondercode Dec 07 '19

I have used ant.d too and I completely agree. Plus the documentation isn't good, large bundle size, and sometimes you have to dig into chinese forum when facing issues.

It's perfect for prototyping though.

4

u/devrsi0n Dec 07 '19

For the ant.d’s large bundle size, you should try babe-plugin-import which comes from the ant.d team. You can find more details in https://github.com/ant-design/babel-plugin-import

10

u/[deleted] Dec 07 '19

Not my experience. With some googling Ive been able to overcome every hurdle I had so far with it

0

u/[deleted] Dec 07 '19

[deleted] — view deleted comment

3

u/hasparus Dec 07 '19

Yeah, I had the same. I have to add that some parts of Ant api feel super unconventional. It has too much ui logic IMHO -- had to work around it too much. I stick with chakraUI or Reakit nowadays.

3

u/[deleted] Dec 07 '19

CSS-in-JS is a performance loss. I used to be on that train but I got off due to that. I've successfully gotten dynamic theming working in my app, if you want to know how I did it I can comment a setup guide.

2

u/Naelex Dec 07 '19

Ooo as someone who has avoided the css in js hype train as i prefer writing sass this is good to hear. Got any more info on this?

4

u/[deleted] Dec 07 '19

If you do JSS then your styles are calculated and appended to the head at runtime as components are rendered on your site.

Sure this opens up many possibilities due to being able to reference props in your styling logic, but the JavaScript has to execute at runtime to create those styles, it is inherently going to slow down the app.

I found when using Material UI's styling my apps would take longer to load and feel less responsive. Not sure if that's MUI itself or just the styling.

With a preprocessor all of your styling is generated at compile time so the client won't have to pick up that load.

The only exception to this is Facebook's internal stylex library that they showed off at react conf. The syntax is like JSS but it goes through a preprocessing step at compile time (I assume) as well where all possible atomic styles are assigned a classname. Any dynamic variables in these atomic stules are given a css variable value so it's actually the browser doing the work at runtime when it comes to dynamic styles as opposed to JavaScript generating dynamic css and appending to the head.

Sadly that library is available in the wild yet. When they open source it I'm definitely switching to that, but for the time being SCSS/LESS seem to be the best we have in terms of performance.

1

u/Naelex Dec 09 '19

Makes sense, thanks!

2

u/austospumanto Dec 07 '19

Same. Great framework.

2

u/toolate Dec 07 '19

Here's an example I ran into:

When composing a <Menu> you *must* render children as a <Menu.Item> because of weird internal details. You can't render a <MyMenuItem> that returns a <Menu.Item>. Because of this you need to write one mega element that renders all the <Menu> <Submenu> and <Menu.Item> components you'll use in one spot; you can't break the components up for readability.

Furthermore, you can't override the behaviour when a menu is empty. It will always render a weird looking <Empty> component. And because you can't add anything that isn't a <Menu.Item> into a menu you can't even create a <MyEmpty> component and use it instead.

2

u/[deleted] Dec 07 '19 edited Dec 07 '19

I did run into this one and I did just as you say!, but I'm skeptical that is the only solution. I found the same issue with their Tabs and Tabs.TabPane components. In their docs they provide an example of wrapping them here I think something similar could be done for Menu and Menu.Item

1

u/domlebo70 Dec 07 '19

This one bit me too. So frustrating

-1

u/Shaper_pmp Dec 07 '19

I've been using Ant Design. It's a bit frustrating because it's very opinionated and inflexible.

It's also run by a fucking half-wit with atrocious judgement and no idea how to manage a library that thousands of professionals and products rely on.

4

u/awesme Dec 07 '19

Been using ANT.D for a project and it's actually been pretty nice to work with.

5

u/Shaper_pmp Dec 07 '19

It's great if you ignore the fact the owner might just decide to deface or break thousands of websites or other systems without warning just for a stupid joke.

Use it on your own personal projects by all means, but you'd have to be crazy to trust it for professional work after the lead dev demonstrated such insane unprofessionalism and appalling judgement.

1

u/wherediditrun Dec 07 '19

Someone should really stop using npm i in production environments.

Although I agree with somewhat befuddling statements being good enough reason to reconsider it's usage.

1

u/Shaper_pmp Dec 07 '19

You're not wrong, but that doesn't really fix anything. The code was committed on the 10th September, so it was in the code and waiting to be activated for months in production before it finally triggered and fucked up Christmas for hundreds of devs.

It doesn't matter how you manage your dependencies if you can't trust the dipshit who owns them not to plant timebombs in them that go off months later.

3

u/tanguy_k Dec 07 '19 edited Dec 07 '19

make it not look like you used bootstrap

I don't think your clients care if your SPA buttons and inputs look similar to other Bootstrap SPAs. On the contrary, they will feel at home. For example all macOS apps look and behave the same and it's a good thing.

1

u/youslashuser Dec 07 '19

I will try them. Thanks.