Menu

Sharing a design system with Module Federation
📰

Sharing a design system with Module Federation

DEV Community: react·Darkø Tasevski·about 17 hours ago
#cq01cEXE
#devtoreact#devto#dev#host#react
Long article (2516 words) — no AI summary yet.
Reading 0:00
15s threshold

At work we have a couple dozen internal React apps, most of them webpack 5 builds, and they all share one design system, which is really two projects. A themes package holds the design itself (colors, typography, and how every MUI component should look for each of our brands), and a components project builds our own components on top of it and is deployed as a Module Federation remote that the apps load at runtime. This covers how both are set up, starting with the theme, since that's the part designers work in too, and then the parts of the remote's config I end up explaining most often to people joining the team.

The design lives in the theme

We use MUI, and early on we decided not to wrap its components in our own Button , Chip and so on just to restyle them. Instead the design goes into the theme, through MUI's palette and typography, styleOverrides and defaultProps , and custom variants, so apps keep using the plain MUI components and get our look from the ThemeProvider above them.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.