Replies: 1 comment 1 reply
-
I converted the Merge Roam DB modal using MUI. This is my first time using a design system. Here's my initial impression. Cons:
Pros:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We should start using an existing component library
Athens' internal component library is ad hoc, minimal, and lightly tested. The quality of some of our internal components has reached a local maximum where further improvements may take an order of magnitude more work than we’ve already done, like breadcrumbs (which break when there are too many) and modal dialogs (which are portaled but don’t properly capture focus).
We could solve those specific problems by bringing in utility packages (like
react-popper
andreact-focus-lock
), or we could lean on an existing component library with established patterns and component compatibility. A mature component library will give us access to a well-tested and internally-consistent library of common atoms and utilities, so we can can spend less time worrying about styling, low-level component functionality, and component API design, and more time prototyping and iterating on the product. Raising the level of abstraction will also allow more contributors to create layouts, interactions, and workflows more easily by drawing on the toolbox and documentation that's already available.Material-UI is a fairly complete component library, with a mature API pattern for components, a system for global theme, css, and prop overrides, and flexible methods for local style overrides, on top of reasonably high test coverage and very high real-world usage: Material-UI has 68.8k stars, 22.3k forks, is depended on by 577k GitHub projects, and is in active development, moving toward a 5.0 release later this year.
What should qualify a component library for Athens?
Other libraries that might qualify, but don’t seem as good
What are the downsides of Material-UI?
Further thoughts
Styling systems are a lot more fun to talk about than component libraries because they’re more freeform and creative development tools. Picking a starter component library feels more like a hold-your-nose-and-dive-in thing.
Most of the high-profile options provide styling at runtime rather than buildtime, which has a measurable performance cost. Ideally we’d be able to avoid that cost. Some systems and libraries might support this workflow, but I haven’t found them yet.
Likely Questions
Why not continue making our own components?
Leaning on an established component library favors prototyping speed over a slower and potentially more bespoke waterfall development process like dev -> design -> dev -> polish.
Does leaning into a component library mean deeply tied to another codebase?
Maybe, but it gives us a major speed boost, having all these components ready out of the box. We can continue to make custom components as needed, but we get to focus on the meaningful things instead of everything.
Is Material-UI too tied to Google?
No, the project is not operated by or sponsored by Google, and the theming system is robust. Properly-used, Athens will look like Athens, and nothing else. It supports theme-level changes (like light/dark mode, font, accent colors), global prop overrides (like disabling the button ripple effect), global style overrides (like saying buttons in breadcrumbs should be smaller padding), local style overrides (this button is blue), and class style overrides (this button, with class
X
, is red)What immediate benefits should we expect?
What about Stylefy? Tailwind?
Material UI internally uses and exposes a styling system similar styled-system. Use of this appears to be optional, but it’s an atomic CSS pattern similar to Tailwind.
What are potential good reasons we shouldn't use Material-UI?
What are the practical steps being proposed?
Beta Was this translation helpful? Give feedback.
All reactions